Skip to content
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

Using images not from the file system #156

Open
fsuter opened this issue Feb 23, 2022 · 8 comments
Open

Using images not from the file system #156

fsuter opened this issue Feb 23, 2022 · 8 comments

Comments

@fsuter
Copy link
Contributor

fsuter commented Feb 23, 2022

When using images from a FAL storage other than the local file system, the images will have public URLs which are absolute URLs. In file rte-ckeditor-image/Resources/Public/JavaScript/Plugins/typo3image.js, when an image in inserted, the protocol/domain part is stripped with method urlToRelative which is okay when the file is local, but definitely not when the file is on some remote server (e.g. a S3 server).

I'm not sure how to fix this at best, as there could be side effects. In my case, since all files are on a S3 server, I just patched the JS to change line 267 from:

src: urlToRelative(getImg.url),

to

src: getImg.url,

@sypets
Copy link
Contributor

sypets commented Mar 23, 2023

@fssuter Can you add your version numbers (TYPO3 and rte_ckeditor_image)? I assume, this issue still exists but some things have changed between TYPO3 versions.

@fsuter
Copy link
Contributor Author

fsuter commented Mar 29, 2023

I'm using TYPO3 11.5.24 and rte_ckeditor_image version 11.0.6

Indeed there seems to have been a lot of changes since then...

@DavidBruchmann
Copy link

shouldn't the storage be responsible to deliver the domain?

@fsuter
Copy link
Contributor Author

fsuter commented Mar 29, 2023

That's not the issue (or I misunderstand your question). In the case of the S3 driver that I am using, it provides correct, fully qualified URIs to the images in the "publicUrl" property, but that is then "truncated" in the extension's JS.

@DavidBruchmann
Copy link

ok, then I misunderstood the problem.

@Gitsko
Copy link
Contributor

Gitsko commented May 27, 2024

@fsuter does the problem still exist ?

@fsuter
Copy link
Contributor Author

fsuter commented May 28, 2024

Sorry for not following up, I only recently got to putting the web site where I had the problem through a major update.

The problem does not exist anymore, although the code that originally caused the problem is still there. So I don't really understand why, but it works.

@fsuter fsuter closed this as completed May 28, 2024
@fsuter
Copy link
Contributor Author

fsuter commented Jun 28, 2024

Actually the problem still exists. I'm not sure how I missed it. The fix I proposed is still valid as far as I'm concerned, but I don't know if it may have side effects. One sure thing is that this is the only use of function urlToRelative(), but it was certainly introduced in the first place for a reason.

At least, images from a local storage like "fileadmin" still work fine after the change.

@fsuter fsuter reopened this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants