Review main Merged

71556[BUGFIX] Consider hideAtCopy and disableHideAtCopy for page translation

André Buchmann CR +2 V +2 Expert +2015 −2 updated 11/15/21, 20:30

Commit message

In TYPO3 v8, new page translations within pages_language_overlay
were visible by default when using plain DataHandler.

In TYPO3 v9, due to the merge into "pages" for translations,
the default value for "hidden" is used. Every new page translation
was hidden by default - this was a different behavior.

Issue #88248 changed this and restored the behaviour how it was in
TYPO3 v8, this translated pages where always visible.

This patch consider TCA configuration 'hideAtCopy' and TSconfig setting
'TCEMAIN.table.pages.disableHideAtCopy' options for page translations
if source page is not already hidden. Further datahandler tests are
added to cover these cases and prevent regressions on that.

As the patch for #88248 already has been stating:

For future TYPO3 major versions, the hidden field could be migrated
into a 'allowLanguageSynchronization' once the Context API is used
throughout Core properly.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 47

Show 27 more files

Review log 3239

Show 1214 earlier messages
  1. André Buchmann uploaded patch set 1 10/12/21, 09:47

  2. Benni Mack voted on patch set 1 CR +1 10/12/21, 09:54

  3. core-ci voted on patch set 1 V -1 10/12/21, 10:10 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17956

  4. André Buchmann uploaded patch set 2 10/12/21, 10:11

  5. core-ci voted on patch set 2 V +1 10/12/21, 10:30 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17959

  6. Benni Mack voted on patch set 2 CR +1 10/12/21, 12:32

  7. Stefan Bürk voted on patch set 2 CR +1 10/12/21, 13:41

  8. Jochen Roth voted on patch set 2 V +1 CR +1 10/12/21, 13:48

  9. Stefan Bürk commented on patch set 2 V +1 10/12/21, 13:56

    Verified in a instance (10.4) manually with differenct constellations/overrides. Would love to see tests covering this (for the future). Not sure about opinion from Benny or others. If not in this patch, I would try to add tests in a seperate patch at the weekend if that would be fine for anyone. Then it would not be a blocker for now. As such not voting -1 for now as no other mentioned tests yet.
  10. Christian Kuhn commented on patch set 2 10/12/21, 14:02

    should we cover that with a functional test?
  11. Stefan Bürk commented on patch set 2 10/12/21, 14:04

    Reply

    Asked that too. May add some at the weekend, either in this patch or as new one (if no other would do it).
  12. Stefan Bürk wrote 10/12/21, 14:05

    Removed Code-Review+1 by Stefan Bürk <stefan@buerk.tech>
  13. André Buchmann commented on patch set 2 10/12/21, 14:43

    Reply

    I have no experience with functional tests. I would also like to have tests for this, but it may also hardens the different behaviour for pages compared to tt_content etc?
  14. Christian Kuhn commented on patch set 2 CR -1 10/12/21, 18:14

    Let's give Stefan a chance to come up with a functional test setup for this before merge.
  1. André Buchmann commented on patch set 2 10/13/21, 07:05

    FYI this patch could also be applied to TYPO3 9.5. But as it is now ELTS I didn't set it as target.
  2. Stefan Bürk commented on patch set 2 10/13/21, 07:16

    Reply

    As you said, master+10.4 as targets are correct.
  3. Stefan Bürk commented on patch set 2 10/28/21, 11:17

    Reply

    We/I will take care of that. Just did not had the time lately as was full with other tasks (for core and daily work), but that was not forgotten. It's on my todo list to came up with tests for it. Maybe I find this (long) weekend time to get this done.
  4. Stefan Bürk commented on patch set 2 V 0 CR -1 11/13/21, 18:21

    I will do following now to verify added tests are working as intended: - Patchset 3: Added datahandler tests (core + workspaces), disabled fix => should fail - Patchset 4: Reactivate fix (but incorporate my comments ) => should be green

    DataHandler.php:4578

    Suggest to use a more speaking on, like $tableEntries. That would match the logic which is done some lines above.

    DataHandler.php:4579

    Should add a null coalescing operator for 'hideAtCopy' and 'disableHideAtCopy', if key is not set to avoid array key access warning.
  5. Stefan Bürk uploaded patch set 3 11/13/21, 18:24

  6. core-ci voted on patch set 3 V -1 11/13/21, 18:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19230

  7. Stefan Bürk uploaded patch set 4 11/13/21, 18:39

  8. core-ci voted on patch set 4 V -1 11/13/21, 18:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19231

  9. Stefan Bürk uploaded patch set 5 11/13/21, 19:12

  10. core-ci voted on patch set 5 V +1 11/13/21, 19:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19232

  11. Stefan Bürk commented on patch set 5 V +1 CR +1 11/13/21, 19:35

    Reply

    Little correction on that: Patchset 3 had cgl issues in the csv files, had been fixed. So: - Patchset 4: Added datahandler tests (core + workspaces) with disabled fix => should fail and failed - Patchset 5: Reactivated fix and incorporated my comments => should be green and were green

    Reply

    Done
    Tests added and green. Changed commit message to reflect more the history of the issue.

    DataHandler.php:4578 Reply

    Done

    DataHandler.php:4579 Reply

    Done
  12. Oliver Hader commented on patch set 5 11/15/21, 10:47

    AbstractActionTestCase.php:522

    I think there might be a new method `updateRecord($tableName, $id, $values)` and then * `$this->updateRecord(self::TABLE_Page, self::VALUE_PageId, [$hiddenFieldName => 0]);` * `$this->updateRecord(self::TABLE_Page, self::VALUE_PageIdWebsite, ['TSconfig' => 'TCEMAIN.table.pages.disableHideAtCopy = 0']);`
  13. Stefan Bürk commented on patch set 5 11/15/21, 12:16

    AbstractActionTestCase.php:522 Reply

    Ack. Will add this. Thanks for pointing this out.
  14. Stefan Bürk wrote 11/15/21, 13:18

    Removed Code-Review+1 by Stefan Bürk <stefan@buerk.tech>
  15. Stefan Bürk wrote 11/15/21, 13:18

    Removed Verified+1 by Stefan Bürk <stefan@buerk.tech>
  16. Stefan Bürk uploaded patch set 6 11/15/21, 17:40

  17. core-ci voted on patch set 6 V +1 11/15/21, 17:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19311

  18. Stefan Bürk commented on patch set 6 11/15/21, 17:59

    AbstractActionTestCase.php:522 Reply

    Thanks Oliver, thought about that again during adding two more tests cases which were missing and removing unneded things. Removed the unnecessary update calls (hidden = 0). Instead of intstruct a new abstracted method the importDefaults.csv should be extended to have these cases directly in the dataset in a separated refactor patch, instead of manipulating them at the start. And to make clearer what is really done (direct db update and not datahandler), keep the change in the abstract method until it was moved to the dataset. Would this be fine for you ?
  19. Christian Kuhn updated the commit message in patch set 7 11/15/21, 19:46

  20. Benni Mack voted on patch set 7 V +1 CR +1 11/15/21, 19:46

  21. Stefan Bürk voted on patch set 7 V +1 CR +1 11/15/21, 19:49

  22. core-ci voted on patch set 7 V +1 11/15/21, 19:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19317

  23. Christian Kuhn voted on patch set 7 V +2 CR +2 11/15/21, 19:59

  24. Christian Kuhn merged patch set 8 11/15/21, 19:59

  25. Stefan Bürk commented on patch set 8 11/15/21, 20:30

    AbstractActionTestCase.php:522 Reply

    Done