Image URL is wrong in frontend when I'm logged out


I’m using the new editor for Kirby 3 and I’m running Kirby v.3.4.4. When I’m logged in to my panel, I get this output for an article in the frontend:

    <img src="http://localhost/kirby/media/pages/blog/<article title>/<some string>/image.png" alt="">

When I’m logged out of my panel, I get this output in the frontend (image is broken):

    <img src="http://localhost/kirby/media/pages/blog/<article title>/<string differs here>/image.png" alt="">

I simplified the filename to image.png in both examples. Only the part <some string> and <string differs here> differ in the image URLs. Output 1 shows the image properly. Output 2 is a broken image.

What did I do wrong? I’m surprised that the output differs depending on my log-in status but I did something wrong for sure. To be honest I didn’t debug this much because I don’t see what this could cause. I had some pause with the project and found it by chance.

I use <?= $page->text()->blocks() ?> to output the article text.

A caching or cookie issue can’t be the origin of this as the browser session is always a new one when I restart the browser. There’s only one page.create:after hook to create a child item and to update the child. This happens on a WAMP setup.

Best Regards,

Are you using the latest version of the editor? Can this be reproduced in a fresh Starterkit with the editor installed?

I just downloaded the latest editor version of the master branch and deleted the editor folder and unzipped it there again. Afterwards it was still broken although the folder structure of the online version was different to my local editor folder structure. Thus I did double click on the images and chose the same images again and saved the page. Result: It shows the images properly now after log-in or log-out. It must have been some issue either by updating/using different editor versions or because I might have had some editor plug-in I forgot to review. I think this is solved and I will accept yours as the solution. If this reoccurs, I will reopen the thread.

Thank you!

I have the same issue :frowning: for all the articles that was created before the latest version of the editor.
I deleted the cache to make sure it’s not a cache related problem. Can’t figure out why nor how to fix. I wonder if the mighty @texnixe has some suggestions.

Yes - entering in every single article in the backend and saving it do the trick, but I have tons of articles…

Can’t you do a search&replace in an editor?

I don’t know what to search.
I would like to understand why I see different thinks depending on the fact Im logged in or not.

I agree. It would be cool to know how this can depend on the log-in status (maybe we can do some cool stuff with that if we know how it works/happened) and I suspect it’s not that easy to do search and replace for this.

Have you deleted the media folder after updating the editor? If that doesn’t help:

Could you please check what changes exactly happen when you save an article again. Maybe make a copy of such a file first then diff those two versions.

Thank you. I deleted the media folder, but with no success.
Being stuck, I run a massive $page->upload() and now it’s ok.