#95688Storage folder outside of page tree does not allow translations
Description
I’ve recently ran into an issue regarding translation on storage folders that are located outside of the main page trees where I was in some cases unable to translate the folder itself or create new translations for records situated inside of this folder.
Linux
PHP 7.4
TYPO3 10.4.20 + 10.4.21
The LocalConfiguration.php defines all available languages and moving the folder inside on of the page trees allows me to properly translate the folder and its contained records.
Comparing this to a copy of the same system with an earlier version of TYPO3 (10.4.17) I see that this works as I’d expect it. I’ve copied the configuration and the database from the 10.4.20 system to the 10.4.17 system and the behaviour stays as expected in the 10.4.17 version, so I guess there is something wrong there.
I’ve not started any further investigations in what might be the issue yet, but I’ll go down that rabbit-hole this afternoon.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 5
-
Tizian Schmidlin commented 10/18/21, 12:07
-
Oliver Hader changed category 10/20/21, 13:35
-
Benni Mack commented and changed status
NewNeeds Feedback 01/06/22, 12:19IMHO all pages should have a site configuration, as “0” is merely a result of things like sys_category or sys_file_metadata, which could reside on “0”. Otherwise it is much useful to exactly define the languages available for a site (= storage folder). Why? Because one might have different default language IDs for different page trees (yes, this concept existed also in prior versions and had always been a flaw). The only real solution is to define languages per page tree root.
-
Oliver Hader commented and changed Tags pending-close 11/03/22, 12:41
I think we can close this one, can’t we? A real solution would require a unique assignment like using locales.
-
Georg Ringer commented and changed status
Needs FeedbackClosed 06/10/24, 18:15closing as suggested. feel free to contact me on slack if you don’t agree
Well, that was faster than expected.
{{collapse(Show diff from 10.4.17 to 10.4.20,Hide diff)
}}
Looking into the
TranslationConfigurationProviderclass explains why this does not behave in the same way as before:{{collapse(Show code exerpt, Hide code exerpt)
}}
Outside of a valid page tree, no languages are available, except if we are on page 0. Now this should probably be the same behaviour for the NullSite as well (at least IMHO, since anything else would break previous behaviour, even though the previous version was the buggy behaviour to begin with).
As far as I can see, there is no proper way to solve this:$pageId === 0to replace the code from the catch$pageId === 0inside the catch and try to create aSiteobject, but then we use Exceptions to handle logic, which is a huge code smellI’m willing to provide a patch for both possibilities, if there is interest and this is really not the intended behaviour, if it turns out that this works as intended and my workflow is wrong, I’ll keep the patch for myself :-)
Any thoughts?