- Issue created by @blacksnipe
- 🇧🇪Belgium blacksnipe
I've added a quick patch that solves my issue, but not sure if it solves it completely. Review required.
- 🇨🇦Canada joseph.olstad
Nicely done! This will need a full review.
Thank you very much.
How I deal with this usually is disable translation on the managed file reference, since the managed file it'self has it's own translation.
- 🇨🇦Canada joseph.olstad
ah ok, I looked at the patch, will have to test more, I'm probably using file_entity instead, which is probably incorrect.
should use managed file which is a core thing. -
joseph.olstad →
committed 33ba33fa on 2.0.x
Issue #3497588 by blacksnipe, nidhish: Add support for managed files
-
joseph.olstad →
committed 33ba33fa on 2.0.x
- 🇧🇪Belgium blacksnipe
Thanks Joseph.
But as I was afraid, there's an issue with the handling.
The translated file isn't properly read from the values array, which means the uploaded files for translated fields aren't actually saved.I've attached a revised patch from #3 that stores the uploaded values, just like the provided values of an image field.
Basically, it's the same process with an array of fids.Kind regards.
-
joseph.olstad →
committed dd63728c on 2.0.x
Issue #3497588 by blacksnipe, joseph.olstad, nidhish: Add support for...
-
joseph.olstad →
committed dd63728c on 2.0.x
- 🇨🇦Canada joseph.olstad
Pushed that in, I'll tag a release now.
Would be nice to get some basic automated test as I recently did for the safedelete module. (incomplete testing but has "something"). - 🇧🇪Belgium blacksnipe
Hi,
I’ve noticed a related issue that might be connected to this discussion. When using the
etuf
-module, thefile_managed
field appears to store translated files in the temporary directory (/tmp or equivalent) rather than the designated sites/*/files folder.Steps to Reproduce:
- Create or edit an entity with a
file_managed
field in a multilingual setup. - Translate the entity, ensuring a file is added or replaced in the translation.
- Save the entity and check the storage location of the translated file.
Observed Behavior:
Translated files are being stored in the temporary directory, causing:- Potential loss of files after temporary cleanup.
- Files not adhering to the expected sites/*/files structure.
Expected Behavior:
Translated files should be stored in the sites/*/files directory, consistent with the standard Drupal file storage pattern.I believe this behavior to be related to the underlying issue discussed here, but I'm happy to create a new issue if it's unrelated.
- Create or edit an entity with a
- 🇧🇪Belgium blacksnipe
It's a possible work-around, but not really beneficial for this module if you already have a translation setup (based on one field) and the client wants to simplify translations by placing everything in one form. ;-)
But I'll try to give it a look as soon as I can.
- 🇨🇦Canada joseph.olstad
Ok, I am hoping you have time to work on this, appreciate it a lot!