Review main Abandoned

61308[BUGFIX] Foreign language records should not be loaded

Jonas Schwabe CR 0 V 0 Normal +45 −13 updated 09/23/20, 15:05

Commit message

This fixes a bug in the extbase DB backend that occured when:
a) The language used to fetch records was 0 (default language)
b) A record X that has a different language was fetched
   (e.g. as part of a relation)
c) The language parent of X was also fetched

The parent record has language 0 by definition and is therefore
the record that should be returned, as the current language is also 0.

To allow relations that do not refer directly to the default language
record, extbase sets the record language to 0 and let the core handle
the language overlay. If the current language is 0 as well the record
is returned instead of overlayed (as it looks like being in the correct
language already). This leads to foreign language records being
returned which is not desired behavior.

To fix this an additional check was added to make sure that the current
language is not 0 - in this case a language overlay is not neccessary
at all and should not be done to prevent the described behavior.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 3

Review log 1418

  1. Jonas Schwabe uploaded patch set 1 07/16/19, 16:32

  2. TYPO3com voted on patch set 1 V +1 07/16/19, 16:43 Completed build in 10m 39s on Tue, 16 Jul, 06:43 PM Test Summary: 47121 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35106

  3. Tymoteusz Motylewski commented on patch set 1 07/16/19, 16:56

    TranslationTest.php:483

    please describe the test case in the comment so one don't have to read and follow fixtures to have an idea what is tested
  4. David Bruchmann commented on patch set 1 07/16/19, 17:05

    > Patch Set 1: > > (1 comment) I think the fake entries should be abolished absolutely as the lead to problems in the core. Sorry but I don't mind if the patch is working or not.
  5. Jonas Schwabe uploaded patch set 2 07/16/19, 20:15

  6. Jonas Schwabe commented on patch set 2 07/16/19, 20:16

    TranslationTest.php:483 Reply

    Done
  7. TYPO3com voted on patch set 2 V +1 07/16/19, 20:27 Completed build in 11m 44s on Tue, 16 Jul, 10:27 PM Test Summary: 47121 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35110

  8. Markus Klein commented on patch set 2 07/16/19, 21:08

    the change seems to make sense, but I still have one wish: Please consider rephrasing the commit message. I did not understand what this change is about until I read the actual code adjustment. Having really good commit messages helps a lot in this extremely complex area of extbase. One more question: Did you try whether the new test really fails without the patch? (I didn't, but it would be very important.) Thanks.
  9. Jonas Schwabe commented on patch set 2 07/16/19, 21:30

    > Patch Set 2: > > the change seems to make sense, but I still have one wish: > > Please consider rephrasing the commit message. I did not understand what this change is about until I read the actual code adjustment. > Having really good commit messages helps a lot in this extremely complex area of extbase. > > One more question: > Did you try whether the new test really fails without the patch? (I didn't, but it would be very important.) > > Thanks. Hi Markus sure I will try to find a better summary tomorrow. However describing what the change does was quite hard for me - probably because I'm missing some important terminology. I will try my best :) The test case fails without the change (the English title was returned instead of 'Post2').
  10. Jonas Schwabe updated the commit message in patch set 3 07/17/19, 07:40

  11. TYPO3com voted on patch set 3 V +1 07/17/19, 07:50 Completed build in 09m 41s on Wed, 17 Jul, 09:50 AM Test Summary: 47121 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35118

  12. Markus Klein commented on patch set 3 07/19/19, 08:54

    TranslationTest.php:2 Unresolved

    I would prefer to remove these cosmetic changes from this patch

    TranslationTest.php:83 Unresolved

    also these

    TranslationTest.php:486 Unresolved

    twice the article
  13. David Bruchmann commented on patch set 3 07/19/19, 09:51

    > Patch Set 1: > > > Patch Set 1: > > > > (1 comment) > > I think the fake entries should be abolished absolutely as the lead to problems in the core. > Sorry but I don't mind if the patch is working or not. On general I'd like to have hooks like in Frontend\Page\PageRepository (pre and post) then it would be possible still to fix something, i.e. related to powermail if the translation is determined wrong (or perhaps a userdefined fallback). But that's probably an own new issue.
  14. Jonas Schwabe commented on patch set 3 07/19/19, 12:45

    > Patch Set 3: > > > Patch Set 1: > > > > > Patch Set 1: > > > > > > (1 comment) > > > > I think the fake entries should be abolished absolutely as the lead to problems in the core. > > Sorry but I don't mind if the patch is working or not. > > On general I'd like to have hooks like in Frontend\Page\PageRepository (pre and post) then it would be possible still to fix something, i.e. related to powermail if the translation is determined wrong (or perhaps a userdefined fallback). But that's probably an own new issue. But you can simply use the Hooks in PageRepository if needed: The result is not processed any further after returned from PageRepository as far as I can tell.
  15. Benni Mack wrote 11/09/19, 09:10

    Topic set to extbase
  16. Benni Mack updated the commit message in patch set 4 05/25/20, 18:41

  17. TYPO3com voted on patch set 4 V -1 05/25/20, 18:49 Completed build in 06m 08s on Mon, 25 May, 06:49 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3523

  18. Jonas Schwabe abandoned the change 09/23/20, 15:05