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

Issues inserting images. Incorrect media path. #687

Open
trapexit opened this issue Oct 20, 2022 · 5 comments
Open

Issues inserting images. Incorrect media path. #687

trapexit opened this issue Oct 20, 2022 · 5 comments

Comments

@trapexit
Copy link

I recently updated a lot of things so forgive me if perhaps I'm missing something. I've got a nginxproxy/nginx-proxy container fronting the linuxserver.io's dokuwiki image with the PHP7 changes I mentioned in a previous ticket. After moving to this I thought this was working but a few things updated recently.

When using ckgedit plugin and attempting to insert an image the URL generated is /data/media/RELPATH where RELPATH is the relative media path. For instance: /data/media/wiki/logo.png

But the public url to the image is: /_media/wiki/logo.png or /lib/exe/fetch.php?media=wiki:logo.png when using the DW Filebrowser.

Is the expectation to create a rule to redirect? It looks like this is hard coded into lib/plugins/ckgedit/fckeditor/editor/filemanager/connectors/php/config.php

@turnermm
Copy link
Owner

I have no personal experience with nginx or nginx proxies. But there is a user contributed item on the ckgedit plugin page about how to handle proxies

@trapexit
Copy link
Author

The question isn't about the proxies but about how paths are generated by the ckgedit file browser. The path generated by ckgedit's file browser is not valid in my setup and I'm trying to find out why. http://domain/data/media/ is not where files are stored on DokuWiki typically.

Take this image from the main dokuwiki site. It uses /_media/... https://www.dokuwiki.org/_media/marketing:hackfest.jpg

The result of using ckg file browser
image

The result of using dw file browser
image

Whereas the path I would expect to see is /_media/wiki:logo.png if relying on rewrites by the webserver.

The code that appears to set this is

$data_media = $isWindows ? 'data\\media\\' : 'data/media/';
and has been around forever. So in the past either it was modified somewhere or people used rewrite rules but I don't recall setting up rules in a previous setup.

@turnermm
Copy link
Owner

_media/wiki/logo.png
 /lib/exe/fetch.php?media=wiki:logo.png

These are functionally equivalent.

@trapexit
Copy link
Author

Yes. But as I showed above the file browser is returning /data/media/wiki/logo.png... not /_media/wiki/logo.png

@turnermm
Copy link
Owner

http://domain/data/media/ is not where files are stored on DokuWiki typically.
Not true.

In any event the ckgedit filebrowser does get the correct url for its use in the image dialog's location bar:

Here, for instance is an example from a test wiki:
imgurl

The problem as I initially suggested is probably in the proxy set up.

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

2 participants