getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.27k stars 167 forks source link

[3.6.0-alpha.2] File source url broken on draft pages #3587

Closed afbora closed 3 years ago

afbora commented 3 years ago

To Reproduce
Steps to reproduce the behavior:

  1. Go to panel
  2. Edit any pages that have files
  3. Change status page to draft
  4. Go to file details
  5. Click to file to see source
  6. See issue

Kirby Version

develop branch

Additional context

This issue only for draft pages and file url like /photography/trees/last-tree-standing.jpg instead /media/pages/photography/trees/..

distantnative commented 3 years ago

@lukasbestle this is caused by us changing the URL to the public permanent URLs... for drafts those won't work. Should we switch back? Try to differentiate (maybe tricky)?

lukasbestle commented 3 years ago

I think the cleanest solution would be token support for file URLs in draft pages. Basically like with the preview URLs for pages, Kirby would add a ?token= query param.

bastianallgeier commented 3 years ago

distantnative commented 3 years ago

Looks like Bastian decided to go the simple way :D

bastianallgeier commented 3 years ago

Including the token in the URL wasn't as trivial as I thought. The token method is protected and making it public didn't seem a good decision just to fix this. I also think it can be expected that the URLs of files in drafts are not permanent.