Review main Merged

87915[BUGFIX] Fix extbase persistence with wrong localized UID scheme

Garvin Hicking CR +2 V +2 Easy +12 −2 updated 03/10/25, 18:52

Commit message

Extbase `<f:form>` editing with relations to localized records
utilizes a `[defaultLanguageRecordUid]_[localizedRecordUid]` identity
scheme.

This however cannot be resolved by the TypeConverter for persistence.

This patch spots identifiers created like that and only returns
their defaultLanguageRecordUid, which is the UID that should be
persisted so that overlays can work as currently implemented.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Torben Hansen +1
    • Benni Mack +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 1417

  1. Garvin Hicking uploaded patch set 1 01/28/25, 10:36

  2. Garvin Hicking commented on patch set 1 01/28/25, 10:37

    A sample extension to test this with: https://github.com/bytesinmotion/b4b Please see slack thread for further info: https://typo3.slack.com/archives/C0CRS7RFH/p1738047624729679
  3. core-ci voted on patch set 1 V +1 01/28/25, 10:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73089

  4. Garvin Hicking commented on patch set 1 01/28/25, 10:44

    (Ideally we should add a functional test covering this scenario, I just don't know how to create such a test covering this easily - if someone has a "boilerplate" for it please let me know)
  5. Garvin Hicking commented on patch set 1 02/04/25, 08:47

    From Mathias Brodala in Slack: ``` I wonder if the SelectViewhelper should be adjusted instead to directly use $value->getUid() instead, with all necessary checks around that. This will then always be the default language UID, even for localizations, thus a reliable value. The backend normally handles this the same way. ```
  6. Garvin Hicking commented on patch set 1 02/04/25, 09:19

    More notes, better link to the whole slack thread: https://typo3.slack.com/archives/C03AM9R17/p1738657226055599 ``` - Adjust SelectViewHelper to not use getIdentifierByObject() but $value->getUid() - Adjust AbstractFormFieldViewHelper's `convertToPlainValue()` to also use $value->getUid() (I'm afraid of breakage here?) AbstractFormViewHelper.php has the comment "intentionally not using getIdentifierByObject" there already - Does PersistenceManager->registerNewObject() need adoption too? - Does JsonView->transformObject() need adoption too? - Add "important.rst" to state this "x_y" uid usage and urge 3rd party code to not use getIdentifierByObject() where specific UIDs shall be returned for linking? ``` ``` PersistenceManager::registerNewObject() also looks broken, but unrelated to this topic. If you register multiple unpersisted objects, only the last one will be kept, with null as identifier. ```
  7. Garvin Hicking updated the commit message in patch set 2 V +1 02/28/25, 20:08

  8. core-ci voted on patch set 2 V +1 02/28/25, 20:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74923

  9. Christian Kuhn voted on patch set 2 CR +1 V +1 03/02/25, 01:27

  10. Christian Kuhn commented on patch set 2 03/02/25, 01:27

    PersistentObjectConverter.php:205

    a not here this is legacy handling that should be changed to not happen anymore wouldn't be bad.
  11. Garvin Hicking commented on patch set 3 CR +1 V +1 03/02/25, 07:35

    Published edit on patch set 2.
  12. core-ci voted on patch set 3 V +1 03/02/25, 07:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74959

  13. Torben Hansen voted on patch set 3 CR +1 03/04/25, 18:28

  14. Garvin Hicking commented on patch set 3 03/04/25, 19:11

    PersistentObjectConverter.php:205 Reply

    Done
  15. Benni Mack voted on patch set 3 CR +1 V +1 03/10/25, 16:21

  16. Garvin Hicking commented on patch set 3 CR +2 V +2 03/10/25, 18:51

    We discussed this in a group. I will be merging this as an intentional provisionary fix discussed with Torben, Benni and Christian, because it can potentially negatively impact most extbase relation operations through `<f:form.select>`. The todo note is placed to properly look into this, but we're lacking time to do that at this time. Help is appreciated to address this in a follow-up, and should then also at best include functional tests covering the scenario.
  17. Garvin Hicking merged patch set 4 03/10/25, 18:52