Skip to content

viewableInBrowserObjects configuration not working for links in text blocks #7708

@wesleybl

Description

@wesleybl

Describe the bug
The viewableInBrowserObjects configuration does not work correctly for links created in text blocks. Even with the configuration set to open files in the browser, links created in text blocks continue to generate download URLs (@@download/file) instead of display URLs (@@display-file/file), causing files to be downloaded instead of opened in the browser when the user is anonymous.

To Reproduce
Steps to reproduce the behavior:

  1. Configure viewableInBrowserObjects: ['File'] in the Volto configuration file.
  2. Create a file.
  3. Create a page with a text block.
  4. In the text block, create a link that points to the created file.
  5. Access the page as an anonymous user.
  6. Click on the file link
  7. Observe that the file is downloaded instead of being opened in the browser.

Expected behavior
When viewableInBrowserObjects is configured with ['File'], links to files should open in the browser instead of being downloaded, especially when created in text blocks. The generated URL should be @@display-file/file instead of @@download/file for anonymous users.

Software (please complete the following information):

  • OS: Linux
  • Browser: chrome
  • Volto Version: 19
  • Plone Version 6.1.3

Additional context
In the listing block, this setting works. It seems the setting was designed for the listing block only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions