Project

General

Profile

Actions

Bug #86619

closed

Extbase translation handling for detail page not working

Added by Martin Weymayer about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase + l10n
Target version:
-
Start date:
2018-10-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Unbenannt-1.jpg (340 KB) Unbenannt-1.jpg Martin Weymayer, 2018-10-10 17:57
Actions #1

Updated by Jonas Eberle about 6 years ago

Could you add your TypoScript language config, so all relating to config.*lang*?

Actions #2

Updated by Martin Weymayer about 6 years ago

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]

!!

Actions #3

Updated by Jonas Eberle about 6 years ago

Sorry, I am out then. Didn't grasp site configurations yet.

Actions #4

Updated by Tymoteusz Motylewski about 6 years ago

  • Description updated (diff)
Actions #5

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.

Actions #6

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 :-)

Actions #7

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

Actions #8

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 ...

Actions #9

Updated by Alex Bigott about 6 years ago

Exactely my thoughs. This makes me shrug as well.

Actions #10

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.

Actions #11

Updated by Martin Weymayer about 6 years ago

Thanks!

Actions #12

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.

Actions #13

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.

Actions #14

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

Actions #15

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

Actions #16

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

Actions #17

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

Actions #18

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

Actions #19

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

Actions #20

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

Actions #21

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

Actions #22

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

Actions #23

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

Actions #24

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.

Actions #25

Updated by Tymoteusz Motylewski about 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #26

Updated by Martin Weymayer about 6 years ago

thanks! tested and working correct now.

Actions #27

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF