Review main Merged

88891[BUGFIX] Fix f:form SelectViewHelper with wrong localized UID scheme

Garvin Hicking CR +2 V +2 Normal +86 −14 updated 04/12/25, 15:52

Commit message

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

The two methods `SelectViewHelper->getOptionValueScalar()` and
`AbstractFormFieldViewHelper->convertToPlainValue()` access
these records with a compound identity like this, and return
their full identity string.

This however fails, when for example a model's property with
persisted localized records is checked against matching these
identities, and where just the defaultLanguageRecordUid is
expected (for an "is selected" check of <option> tags).

With this patch, the `getUid()` method calls are preferred
over the full identity, in case we're dealing with
`DomainObjectInterface` objects.

Tests to validate this behaviour in #106493
are adopted, now showing properly selected categories.

An Important.rest has been created to notify consumers of
the `AbstractFormFieldViewHelper` or
`persistenceManager->getIdentifierByObject()` about possibly
needed changes.

Review

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

Issues 5

Files 4

Review log 1622

  1. Garvin Hicking uploaded patch set 1 04/01/25, 19:38

  2. core-ci voted on patch set 1 V +1 04/01/25, 19:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76815

  3. Garvin Hicking commented on patch set 1 04/01/25, 19:54

    HELP, please 😄
  4. Garvin Hicking updated the commit message in patch set 2 V +1 04/02/25, 11:02

  5. core-ci voted on patch set 2 V +1 04/02/25, 11:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76873

  6. Stefan Bürk commented on patch set 2 04/02/25, 17:06

    Reply

    Provided Garvin in slack with a lot of examples and places as inspiration for tests ;).
  7. Garvin Hicking commented on patch set 2 04/02/25, 18:16

    Reply

    I think I'm on track for the tests, stay tuned ;)
  8. Stefan Bürk commented on patch set 2 CR -1 04/03/25, 08:43

    -1 to wait for the tests (maybe make it wip for the time beeing @gh@faktor-e.de)
  9. Garvin Hicking marked it work in progress 04/03/25, 09:44

  10. Garvin Hicking commented on patch set 2 04/03/25, 09:45

    This change is ready for review.
    I marked it with [WIP] because I would like to keep the easy public visibility of this issue, if that's ok.
  11. Garvin Hicking commented on patch set 2 04/06/25, 18:09

    Tests are now added to the related patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/88912?usp=search It contains uncommentable code that proves the bug which is fixed here will pass the test. I propose to first merge the test and then this.
  12. Simon Schaufelberger updated the commit message in patch set 3 CR -1 V +1 04/07/25, 07:02

  13. Simon Schaufelberger updated the commit message in patch set 4 04/07/25, 07:03

  14. core-ci voted on patch set 3 V +1 04/07/25, 07:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77090

  15. core-ci voted on patch set 4 V +1 04/07/25, 07:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77091

  16. Garvin Hicking updated the commit message in patch set 5 V +1 04/07/25, 08:35

  17. core-ci voted on patch set 5 V +1 04/07/25, 08:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77097

  18. Garvin Hicking uploaded patch set 6 V +1 04/11/25, 12:23

  19. core-ci voted on patch set 6 V +1 04/11/25, 12:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77531

  20. Benni Mack voted on patch set 6 CR +1 V +1 04/11/25, 14:52

  21. Stefan Bürk voted on patch set 6 CR +2 V +2 04/12/25, 15:44

  22. Stefan Bürk merged patch set 7 04/12/25, 15:52