-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's not possible to insert an image in an event's description using an external url #6255
Comments
Are you sure this happens in the latest version from Git (not sure which version is installed on your instance)? I'm asking because in #6170 I fixed a problem that converted truly absolute URL to relative ones - it was mainly an issue in emails (where you should never have relative URLs for obvious reasons), but possibly it's the same thing you're encountering here.
Feel free to test it on https://sandbox.getindico.io :) |
In any case, if you are on the latest version, and you create an absolute URL that points to the same host where Indico is running: The behavior is intentional. Absolute URLs pointing to the current instance would break if the instance ever changes (sub)domains. So keeping those links relatives makes more sense. |
In 3.2.9 it was possible to attach images using external URLs |
What error are you getting? Could it be related to being on an older Python version (3.3 requires 3.12.2)? External URLs from other hosts than the Indico host should work fine and not be changed. |
I just tested on my instance and the current behavior is that:
|
Well I did upgrade the python version , deleted my existing env and then recreated it to use the newest version. |
Yes, but it's different from the behaviour from Indico 3.2.9 where URLs from the same Indico instanced remained as absolute paths if so entered. |
The INDICO_CONFIG error should have been fixed with this commit:
(it happened when installing indico in a new virtualenv without setuptools) |
Hmm, my pull included that update but I still got the error.... |
Ugh. Annoying. I guess I'll have to debug this more tomorrow... |
Ok, for now I simply deleted src and reinstalled |
I don't think TinyMCE supports this, unless we force all links to become absolute which we don't want since it's not very portable... BUT: I think the solution for you is simply that your scripts which extract content from Indico should convert links to absolute. This is actually what I do in a custom script that exposes stuff from the Indico API to an external app which needs absolute URLs. We could possibly consider generating absolute links in any APIs that are meant to be consumed from outside Indico... |
I see. Thanks, I will take a look
Cheers
…On Wed, Mar 27, 2024 at 5:06 PM Adrian ***@***.***> wrote:
In our case we need it to remain absolute so that when we update our other
sites with the content from Indico, the images can be correctly rendered
I don't think TinyMCE supports this, unless we force all links to become
absolute which we don't want since it's not very portable...
BUT: I think the solution for you is simply that your scripts which
extract content from Indico should convert links to absolute. This is
actually what I do in a custom script
<https://gitlab.cern.ch/indico/feed-aggregator/-/blob/master/app.py?ref_type=heads#L45-77>
that exposes stuff from the Indico API to an external app which needs
absolute URLs.
—
Reply to this email directly, view it on GitHub
<#6255 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPG2BIB7L7GKNVE3GKMUDTY2MRDFAVCNFSM6AAAAABFLS2VLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRTHE4TAMRTGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi all, @OmeGak ,
In the new 3.3 version of Indico, the CKEditorWidget has been replaced with TinyMCEWidget.
I noticed that in this new TinyMCEWidget widget, the constructor by default sets absolute_urls = False.
In an Event's description field it is now not possible to set an absolute path to images attached in the description: If I do, it will get converted to an internal url.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We would expect that the image source remains as an external url
Screenshots
Additional context
I see that the TinyMCEWidget constructor by default sets absolute_urls = False
See src/indico/web/forms/widgets.py
The text was updated successfully, but these errors were encountered: