Review main Merged

68925[BUGFIX] Handle workspace overlays in AbstractItemProvider

Oli Bartsch CR +2 V +2 Easy +19 −2 updated 05/03/21, 08:15

Commit message

The AbstractItemProvider method for fetching records
from `foreign_table`, e.g. used in selectSingle types,
missed proper workspace handling and therefore listed
the same record (online and offline) multiple times.

This is now fixed by adding the WorkspaceRestriction,
and applying proper overlay handling (e.g. removing
delete placeholder and move pointers).

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Christian Kuhn +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Christian Kuhn +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1620

  1. Oli Bartsch uploaded patch set 1 04/29/21, 22:29

  2. core-ci voted on patch set 1 V +1 04/29/21, 22:42 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10946

  3. Christian Kuhn commented on patch set 1 04/29/21, 22:56

    Good one! That's a significant bug to fix here. Will give it a detail review and testing shot tomorrow.

    AbstractItemProvider.php:350

    draft review: not 100% sure about 4th param.

    AbstractItemProvider.php:604 Unresolved

    that's ok for sure.
  4. Oli Bartsch commented on patch set 1 04/30/21, 01:10

    Reply

    Yes, really important IMO. Thanks for testing.

    AbstractItemProvider.php:350 Reply Unresolved

    Without the 4th parameter, the live record is not removed in case the offline record is a move placeholder. Thats indeed what the bug report is about. Let's say we have three records: * UID 1: Live record * UID 2: Live record * UID 3: Offline record - Move placeholder with t3ver_oid=1 In workspaceOL(), getWorkspaceVersionOfRecord() gets called for each of them. Following happens: * UID 1 is overlayed and gets t3ver_state=4 assigned. * UID 2 can not be overlayed as no offline record exists * UID 3 can not be overlayed as it is already an offline record The result is: * UID 1: [t3ver_state=4, t3ver_wsid=1, ..] * UID 2: FALSE * UID 3: FALSE So no further changes to UID 2 and UID 3, since the function ends in case the result of the overlay is FALSE. UID 1 passes the check, since the getWorkspaceVersionOfRecord successfully returned an overlay record. In the following the VersionState is determined and checked against $versionState->equals(VersionState::MOVE_POINTER). If true, like in our case, the row (passed by reference) is set to FALSE, but only in case the 4th parameter is set to TRUE. If so, only UID 2 and UID 3 do still contain the row (since it was not adjusted due to the failed overlay attempt) and are therefore further used in the outside code.
  5. Oli Bartsch commented on patch set 1 CR -1 04/30/21, 13:07

    This fixes the duplicated display but now leads to INVALID VALUE in case the moved record is the currently selected one.
  6. Oli Bartsch uploaded patch set 2 05/01/21, 11:53

  7. core-ci voted on patch set 2 V +1 05/01/21, 12:04 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11005

  8. Benni Mack commented on patch set 2 V +1 CR +1 05/01/21, 14:53

    Nice one. Patch applies clean in my v10.4 installation with the select + tree without overlays now
  9. Christian Kuhn voted on patch set 2 V +1 CR +1 05/01/21, 17:19

  10. Oli Bartsch commented on patch set 2 CR -1 05/01/21, 18:29

    Thanks for reviewing so far. Need to check one thing in more detail.
  11. Oli Bartsch uploaded patch set 3 05/01/21, 19:41

  12. Oli Bartsch commented on patch set 3 05/01/21, 19:42

    Still issues with move placeholder. Therefore WIP for the moment.
  13. core-ci voted on patch set 3 V +1 05/01/21, 19:52 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11025

  14. Oli Bartsch updated the commit message in patch set 4 05/01/21, 20:07

  15. Oli Bartsch commented on patch set 4 05/01/21, 20:10

    Reply

    This patch now fixes several issues including the reported bug. However, there is still a problem with the combination of TCA PID restriction and move placeholders. Since this is not only bound to these specific TCA types, we will fix this in a more generic way in a separate patch.
  16. core-ci voted on patch set 4 V +1 05/01/21, 20:18 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11026

  17. Christian Kuhn voted on patch set 4 V +1 CR +1 05/01/21, 21:41

  18. Benni Mack voted on patch set 4 V +1 CR +1 05/01/21, 23:03

  19. Oli Bartsch voted on patch set 4 V +2 CR +2 05/03/21, 08:15

  20. Oli Bartsch merged patch set 5 05/03/21, 08:15