Imported PO files have no public URL but have a link at admin/content/files

Created on 10 March 2015, almost 10 years ago
Updated 20 February 2023, about 2 years ago

Problem

Imported po files are treated as regular files, and so appear at admin/content/files. When they listed there they have a link, even though they do not have a public URL -by design. Clicking their link gives:

LogicException: PO files URL should not be public. in Drupal\locale\StreamWrapper\TranslationsStream->getExternalUrl() (line 55 of core/modules/locale/src/StreamWrapper/TranslationsStream.php).

file_create_url('translations://en.po')
Drupal\file\Plugin\views\field\File->renderLink('en.po', Object)

Solutions

1. Filter them out in the view, or
2. Soften the error, maybe returning an empty string instead of an Exception.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
File systemΒ  β†’

Last updated 4 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States rpayanm

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024