- πΊπΈUnited States smustgrave
Came up as a daily BSI
Still seems to be relevant but would it be a feature request now though?
When working on #2215507: Downloads broken for translated private files β I noticed that function file_save_upload() does not set File's entity language. This makes File entity to always be saved with hardcoded default language regardless of actual parent language.
For example when saving file field of English node, the File entity language is always 'und'. The same for any other language on mono or multilingual sites.
I think this is wrong especially for translated entities that might actually use different files for their translations. So it would make sense to set File entity language if saving file uploaded via field form.
Also, saving language with a file might help when managing files in core (see #2215507-5: Downloads broken for translated private files β ) or with contributed modules. The schema is there it's just that it doesn't seem to be used at all.
Unfortunately the file_save_upload()
does not provide a way of setting file's language. So I see two options:
file_save_upload()
could accept another parameter specifying language or langcode.file_managed_file_save_upload()
that in this case invokes file_save_upload()
, could set language of the File entity and update it after file_save_upload()
returns.Discuss possible solutions and consequences. Create patch.
None.
Maybe a small change in file_save_upload()
definition (one more parameter)?
Active
11.0 π₯
file system
(Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Came up as a daily BSI
Still seems to be relevant but would it be a feature request now though?