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

Preview links of some files aren't working #6786

Open
samlinck opened this issue Nov 12, 2024 · 4 comments
Open

Preview links of some files aren't working #6786

samlinck opened this issue Nov 12, 2024 · 4 comments
Labels
needs: replication 🔬 Requires a sample to reproduce the issue

Comments

@samlinck
Copy link

Description

The preview link for some files appears as a button instead of a standard link. As a result, clicking it does nothing. However, the file can be accessed by manually copying and pasting the URL.

Initially, I thought it was a Dreamform bug since the file was uploaded through Dreamform. However, after further testing, we found that some files not uploaded via Dreamform also have this issue. Referring issue

Expected behavior

The preview link opens the file url in a new tab.

Screenshots
The file I have problems with
image

The preview button html
image

To reproduce

  1. Go to a file
  2. Try to click on the preview link

Your setup

Kirby Version
4.4.1

Console output
image

Your system (please complete the following information)

  • Device: Macbook Pro
  • OS: MacOs 14.5
  • Browser: Chrome
  • Version: 130.0.6723.117 (Official Build) (arm64)

Additional context

@distantnative
Copy link
Member

Can you reproduce it with a fresh starter kit? Or any actual description to reproduce it? Cause the steps you describe just work fine with the demo kit: https://getkirby.com/try

@distantnative distantnative added the needs: replication 🔬 Requires a sample to reproduce the issue label Nov 12, 2024
@samlinck
Copy link
Author

samlinck commented Nov 12, 2024

Hi sorry for the missing info. I can't reproduce the issue with files uploaded via the panel. But the plugin author does have the issue with other files uploaded via the panel.

  1. Install the starterkit
  2. Install Dreamform
  3. Make a form with an upload field
  4. Upload an image (I tried jpg, png, pdf, gif, mp4) via the form
  5. Visit the submission in the panel
  6. Go to file in the panel
  7. Try to preview file (This doesn't work)

@dominiklaube
Copy link

I can reproduce the issue as described here. The problem occurs when uploading a file to a page with a blueprint that has the preview permission set to false.

What would be the correct solution here? Sometimes, you may want to disable the page preview while still allowing the file preview.

I also noticed in the screenshot that the button classname "k-file-view-options" might be incorrect and should perhaps be "k-file-view-preview" instead.

@nilsmielke
Copy link

nilsmielke commented Nov 19, 2024

Can confirm @dominiklaube’s findings.
Setting preview: true in the page template of the page the file was loaded into, fixes the file preview—as a temporary fix, that is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: replication 🔬 Requires a sample to reproduce the issue
Projects
None yet
Development

No branches or pull requests

4 participants