Bug #86619
closedExtbase translation handling for detail page not working
100%
Description
Detail view in extension are allways shown in default language. Steps to reproduce:
- install new 9.5 and use site configuration for "real url"
- install f.ex. extension news
- make some entries in default language and make localization of articles/news
- translate pages and content elments
- view list of news - > list view shows correct language translation
- click to view detail page - > content shown in default language, no translation
martin
Files
Updated by Jonas Eberle about 6 years ago
Could you add your TypoScript language config, so all relating to config.*lang*?
Updated by Martin Weymayer about 6 years ago
- File Unbenannt-1.jpg Unbenannt-1.jpg added
I use site configuration and have following setup added
[siteLanguage("languageId") == 1]
page.config.htmlTag_langKey = en
config {
sys_language_uid = 1
language = en
locale_all = en_EN
htmlTag_langKey = en-EN
}
[global]
!!
Updated by Jonas Eberle about 6 years ago
Sorry, I am out then. Didn't grasp site configurations yet.
Updated by Susanne Moog about 6 years ago
Not really related to the bug, but a side note:
you should not need to set the typoscript settings anymore if you have a site configuration with configured languages.
Updated by Martin Weymayer about 6 years ago
Thanks, I know - I added ts because site configuration did not work and hoped ts is helping to solve bug :-)
Updated by Alex Bigott about 6 years ago
This is connected to the 'Important 82363' in the upgrade docs for 9.5
In every new install of 9.5 language handling changed.
As I found out this means in this special case that the findAll() method in the repository returns localized values (serving the 'list' view), whereas the findByUid() does not anymore (serving the 'detail' view).
I have the same problem in my extension and to be honest I am not sure if i think this is a good idea.
If you want your old behaviour back and the extension working, you can set the following TypoScript switch:config.tx_extbase.features.consistentTranslationOverlayHandling = 0
Cheers
Alex
Updated by Martin Weymayer about 6 years ago
Thanks! But does the switch-back effect "new" translation handling? If yes, I do not think it is good idea to mix old an new ...
Updated by Alex Bigott about 6 years ago
Exactely my thoughs. This makes me shrug as well.
Updated by Tymoteusz Motylewski about 6 years ago
- Category set to Extbase + l10n
I confirm the issue, will take a look what can we do to lower the hassle for integrators/developers.
Updated by Alex Bigott about 6 years ago
The longer I look into this issue, the more I think there is something seriously broken here.
For me this feels like a huge step back in the way extension developers are working, since from now on fundamentals of how to work in extbase are broken, not to mention that the current status will result in almost every extension there is not working in a fresh 9.5 install when it comes to multilingual projects.
Let's get back to the very core of this topic here: list views and details views (list and show).
On the very core:- in your list action you get all the records and give the result to a view:
public function listAction() { $langtests = $this->langtestRepository->findAll(); $this->view->assign('langtests', $langtests); }
- next in your view you have a for loop over the results and create links
<f:for each="{langtests}" as="langtest"> <f:link.action action="show" arguments="{langtest : langtest}"> {langtest.title}</f:link.action> </f:for>
- in the show action you continue the easiest way
public function showAction(\Alex\Langtest\Domain\Model\Langtest $langtest) { $this->view->assign('langtest', $langtest); }
- and finally the show view displays all
{langtest.title}
And guess what: this does not work anymore!
In the details/show view you will always get the default language and not a translation. This is not just an inconvenience for the developer in my eyes. This is wrong to me.
Updated by Tymoteusz Motylewski about 6 years ago
Hi
Here is a work in progress solution:
https://review.typo3.org/#/c/58635/
It fixes the issue if you have overlay mode set to "true" or "hideNonTrnaslated" for the website (in the global context).
I'm checking whether /how we should also fix the case when overlay mode is set to 0/false.
And other consequences.
This also shows that we desperately need tests for propertyMapper (object converter) which would cover cases when translated record is expected.
If any of you can/want to help in writing these tests, I would be very grateful.
Updated by Gerrit Code Review about 6 years ago
- Status changed from New to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Gerrit Code Review about 6 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58635
Updated by Markus Klein about 6 years ago
We kindly ask all involved persons in this issue to test the latest version of the patch.
Updated by Tymoteusz Motylewski about 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 5e0305969800cb1cd61c098e2c09cab773c54717.
Updated by Martin Weymayer about 6 years ago
thanks! tested and working correct now.