Review main Abandoned

74919[BUGFIX] Unify translation source language resolving

Nikita Hovratov CR 0 V 0 Normal +118 −84 updated 07/29/23, 21:11

Commit message

This patch fixes the visibility of the translation button in the
translation view by unifying existing approaches.

In order to filter out already translated records, a list of default
language record uids was created and then checked against the parent
language of the translated record.

This worked fine for languages which have the default language as the
translation source. But if there are three or more languages with
different language sources, the uids to check against must come from
the appropriate language source.

Actually, this very question is already answered by the
LocalizationController and LocalizationRepository when resolving the
translated record uids. This part is now extracted into a new method
in the repository class and is used for both the controller and
ContentFetcher.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 4

Review log 2738

Show 913 earlier messages
  1. Nikita Hovratov uploaded patch set 1 06/15/22, 15:26

  2. core-ci voted on patch set 1 V +1 06/15/22, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28099

  3. Daniel Haupt commented on patch set 1 V +1 CR +1 06/15/22, 21:26

    Good catch!
  4. Jörg Bösche voted on patch set 1 CR +1 06/24/22, 19:28

  5. Oli Bartsch commented on patch set 1 V -1 06/24/22, 22:34

    Thanks for the patch. I did some testing and found that the button still reappears as soon as a new record is added to the default language, which is not yet translated to the language source of the second translation. Additionally, I found that the same problem (button is shown while no record is available for translation) also exists for the case that we have another language, which *copied* the records from the first localization (so is in free mode). This also should resolve https://forge.typo3.org/issues/94397 in the end, right?
  6. Nikita Hovratov commented on patch set 1 06/25/22, 16:44

    Reply

    Thanks for testing and the feedback. I knew it couldn't be so easy. I will have a look at your described cases. Yes, it seems this is the same issue. I linked it as duplicate, thanks!
  7. Nikita Hovratov uploaded patch set 2 06/25/22, 20:29

  8. core-ci voted on patch set 2 V +1 06/25/22, 20:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28415

  9. Nikita Hovratov uploaded patch set 3 06/25/22, 20:59

  10. core-ci voted on patch set 3 V +1 06/25/22, 21:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28416

  11. Nikita Hovratov uploaded patch set 4 06/25/22, 21:56

  12. core-ci voted on patch set 4 V +1 06/25/22, 22:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28419

  13. Nikita Hovratov marked it work in progress 06/26/22, 16:49

  1. Nikita Hovratov uploaded patch set 5 06/26/22, 18:26

  2. Nikita Hovratov commented on patch set 5 06/26/22, 18:30

    This change is ready for review.
  3. core-ci voted on patch set 5 V -1 06/26/22, 18:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28426

  4. core-ci voted on patch set 5 V +1 06/26/22, 18:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28426

  5. Benni Mack voted on patch set 5 CR +1 06/27/22, 04:12

  6. Markus Klein commented on patch set 5 07/05/22, 06:59

    Maybe I misunderstand, but why? Why shouldn't the wizard help me copy CEs into the free-mode language?
  7. Nikita Hovratov commented on patch set 5 07/05/22, 08:10

    Reply

    Free-Mode means you already have copied content elements from a source language. After that, you are on your own. As there is no connection, there is also no way to identify already copied elements, so the wizard would show you everytime all content elements.
  8. Markus Klein commented on patch set 5 07/05/22, 08:12

    Reply

    They still have a translation source, if I'm not mistaken?
  9. Nikita Hovratov commented on patch set 5 07/05/22, 08:28

    Reply

    l10n_source yes, but not l18n_parent. This is also how free-mode is detected. I can check again if the bug is still present after my recent changes.
  10. Markus Klein commented on patch set 5 07/05/22, 08:49

    Reply

    IMO for free mode the wizard should show all CEs that are not referenced by a l10n_source yet. Use case: Copy newly added CEs from the source language.
  11. Nikita Hovratov uploaded patch set 6 07/05/22, 09:05

  12. Nikita Hovratov commented on patch set 6 07/05/22, 09:06

    Reply

    Yeah, you are right. Seems like I already resolved the problem, so there is no reason not to allow it.
  13. core-ci voted on patch set 6 V +1 07/05/22, 09:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28656

  14. Nikita Hovratov rebased onto patch set 7 07/27/22, 15:00

  15. core-ci voted on patch set 7 V +1 07/27/22, 15:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29622

  16. Riccardo De Contardi commented on patch set 7 V +1 08/03/22, 07:34

    Tested on latest master with the procedure written on the ticket 97763; I used the "translate" (connected) mode.
  17. Nikita Hovratov uploaded patch set 8 09/27/22, 14:49

  18. core-ci voted on patch set 8 V +1 09/27/22, 14:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31598

  19. Nikita Hovratov uploaded patch set 9 09/27/22, 14:59

  20. core-ci voted on patch set 9 V +1 09/27/22, 15:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31599

  21. Nikita Hovratov updated the commit message in patch set 10 09/28/22, 08:59

  22. core-ci voted on patch set 10 V +1 09/28/22, 09:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31641

  23. Gerrit Hübbers commented on patch set 10 09/28/22, 10:46

    LocalizationRepository.php:244 Unresolved

    The TYPO3 core has a bug here in getRecordsToCopyDatabaseResult(..) by using a while loop: When $origUid is 0 (i.e. default language) the while loop incorrectly breaks early, failing to add this and any remaining $origUid to the $originalUids array. Instead e.g. a foreach loop should be used.
  24. Benni Mack updated the commit message in patch set 11 V +1 05/03/23, 09:53

  25. Nikita Hovratov abandoned the change 07/29/23, 21:11

    stale. can be used as inspiration for a new approach.