Review main Merged

85229[TASK] Ensure TcaSchema are sorted alphabetically

Benni Mack CR +2 V +2 Hard +188 −182 updated 02/26/26, 06:55

Commit message

This change makes Schema API more deterministic. For every piece
in user-land code, Schema API has schemas available that is already
ordered, making less problems in various places.

However, this also means that some tests have to be adapted.
Especially all places where a page including its records gets copied
where the records on the pages are now added in a different (= sorted)
order, receiving different autoincrement IDs.

The key is in DataHandler::copyPages(), which gets the
table iteration order from $this->tcaSchemaFactory->all()->getNames().

When copying a page, it loops through all TCA tables to find
records belonging to that page. There are two competing mechanisms
that can copy the hotel records:

1. Table-level iteration — When the outer loop reaches
   tx_testirrecsv_hotel, it queries all hotel records on the page
   and copies them in DB query order (by UID: 3, 4, 5)

2. Inline IRRE processing — When the outer loop processes tt_content,
   copying each content element triggers copyRecord_processRelation()
   which immediately copies the IRRE child records (hotels) inline,
   following the parent record order.

Whichever mechanism runs first wins — the second one finds the
records already copied and skips them.

Before this patch: tx_testirrecsv_hotel happened to appear before
tt_content in the TCA array (undefined insertion order).
So hotels were copied via mechanism 1, in UID order: 3→7, 4→8, 5→9.

With sorted order: tt_content comes before tx_testirrecsv_hotel
alphabetically. So hotels are now copied via mechanism 2,
driven by parent content element order. Element #2 (hotel 5)
is copied first, then Element #1 (hotels 3, 4): 5→7, 3→8, 4→9.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 10

Review log 2739

Show 1014 earlier messages
  1. Benni Mack uploaded patch set 1 07/11/24, 18:53

  2. Benni Mack updated the commit message in patch set 2 07/11/24, 18:57

  3. Christian Kuhn voted on patch set 2 CR +1 V +1 07/11/24, 19:01

  4. Jasmina Ließmann voted on patch set 2 CR +1 V +1 07/11/24, 19:02

  5. core-ci voted on patch set 1 V -1 07/11/24, 19:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61409

  6. Christian Kuhn voted on patch set 2 CR 0 V 0 07/11/24, 19:06

  7. core-ci voted on patch set 2 V -1 07/11/24, 19:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61410

  8. Jasmina Ließmann voted on patch set 2 CR 0 V 0 07/11/24, 19:06

  9. Benni Mack rebased onto patch set 3 V -1 07/15/24, 15:04

  10. core-ci voted on patch set 3 V -1 07/15/24, 15:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61594

  11. Anja Leichsenring uploaded patch set 4 V -1 10/16/24, 10:20

  12. core-ci voted on patch set 4 V -1 10/16/24, 10:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67878

  13. Georg Ringer voted on patch set 4 CR +1 V +1 10/16/24, 11:46

  14. Anja Leichsenring commented on patch set 4 V -1 10/16/24, 11:54

    on it, fixing tests
  1. Anja Leichsenring uploaded patch set 5 CR +1 V +1 10/16/24, 13:37

  2. core-ci voted on patch set 5 V -1 10/16/24, 13:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67884

  3. Anja Leichsenring uploaded patch set 6 V -1 10/16/24, 13:44

  4. core-ci voted on patch set 6 V +1 10/16/24, 13:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67885

  5. Christian Kuhn commented on patch set 6 CR -1 10/17/24, 13:52

    we need to understand where and why DH acts differently when the first level TCA key is sorted alphabetically and which impact this has, before the patch can be merged.
  6. Anja Leichsenring uploaded patch set 7 CR -1 V +1 11/08/24, 08:39

  7. Anja Leichsenring commented on patch set 7 CR -1 11/08/24, 08:40

  8. core-ci voted on patch set 7 V +1 11/08/24, 08:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69223

  9. Benni Mack marked it work in progress 03/21/25, 17:22

  10. Anja Leichsenring rebased onto patch set 8 CR -1 V +1 03/22/25, 13:31

  11. core-ci voted on patch set 8 V -1 03/22/25, 13:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76021

  12. Benni Mack uploaded patch set 9 V -1 03/23/25, 09:17

  13. core-ci voted on patch set 9 V +1 03/23/25, 09:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76061

  14. Benni Mack commented on patch set 9 03/24/25, 10:04

    Reply

    This is happening in DataHandler->getAllowedTablesToCopyWhenCopyingAPage(). For the tests. Before the order was: - tx_testirrecsv_hotel - tt_content - tx_testirrecsv_offer - tx_testirrecsv_price After the order is: - tt_content - tx_testirrecsv_hotel - tx_testirrecsv_offer - tx_testirrecsv_price
  15. Benni Mack uploaded patch set 10 V +1 01/28/26, 18:13

  16. core-ci voted on patch set 10 V +1 01/28/26, 18:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94526

  17. Jasmina Ließmann wrote 02/04/26, 10:00

    Removed reviewer Jasmina Ließmann.
  18. Benni Mack updated the commit message in patch set 11 V +1 02/25/26, 13:22

  19. Benni Mack commented on patch set 11 02/25/26, 13:23

    This change is ready for review.

    Reply

    I now added a proper note to the commit message.
  20. core-ci voted on patch set 11 V -1 02/25/26, 13:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96822

  21. Benni Mack rebased onto patch set 12 V -1 02/25/26, 16:45

  22. core-ci voted on patch set 12 V +1 02/25/26, 16:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96840

  23. Simon Schaufelberger voted on patch set 12 CR +1 V +1 02/25/26, 23:45

  24. Georg Ringer voted on patch set 12 CR +2 V +2 02/26/26, 06:55

  25. Georg Ringer merged patch set 13 02/26/26, 06:55