Review main Merged

79197[BUGFIX] Make Extbase ObjectConverter consider XCLASSed objects

Torben Hansen CR +2 V +2 Easy +28 −2 updated 06/08/23, 12:03

Commit message

When an object has been extended using XCLASS, it is correctly
fetched from persistence respecting the extended class. This
does not apply to non-persisted objects (e.g. Extbase arguments
before being persisted) resulting in property mapping exceptions.

This change ensures, that the `ObjectConverter` will always
respect XCLASSed objects during type conversion.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1521

  1. Torben Hansen uploaded patch set 1 06/06/23, 17:22

  2. core-ci voted on patch set 1 V +1 06/06/23, 17:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42242

  3. Oliver Klee commented on patch set 1 06/06/23, 19:49

    ObjectConverter.php:221

    This probably should go above line 212 so that the XCLASS target type also is checked.
  4. Torben Hansen commented on patch set 1 06/07/23, 05:44

    ObjectConverter.php:221 Reply

    No, since line 212 only applies to the `__type` scenario. I will update the patch, so `GeneralUtility::getClassName()` is used as Alex Schnitzler suggested.
  5. Torben Hansen uploaded patch set 2 V +1 06/07/23, 06:02

  6. core-ci voted on patch set 2 V +1 06/07/23, 06:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42250

  7. Oliver Klee commented on patch set 2 06/07/23, 07:48

    Please let's cover this with tests.
  8. Torben Hansen uploaded patch set 3 V +1 06/08/23, 05:52

  9. Torben Hansen commented on patch set 2 06/08/23, 05:52

    Reply

    Done
  10. core-ci voted on patch set 3 V -1 06/08/23, 06:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42283

  11. Torben Hansen uploaded patch set 4 V -1 06/08/23, 06:25

  12. core-ci voted on patch set 4 V -1 06/08/23, 06:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42284

  13. Torben Hansen uploaded patch set 5 V -1 06/08/23, 06:35

  14. core-ci voted on patch set 5 V +1 06/08/23, 06:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42285

  15. Oliver Klee commented on patch set 5 06/08/23, 07:11

    ObjectConverterTest.php:461

    I'd like to propose this name: `convertWithRegisteredSubclassReturnsInstanceOfRegisteredSubclass`

    ObjectConverterTest.php:473

    We don't need this annotation as we're going to check this with the `assertInstanceOf` call a few lines further below anyway.

    ObjectConverterTest.php:481

    This assertion is not part of what the test is about (that it's an instance of the registered subclass). We probably should either remove it (that's what I would recommend), or (if it's important) move it to a separate test name `convertWithRegisteredSubclassSetsProperties`
  16. Torben Hansen uploaded patch set 6 V +1 06/08/23, 07:59

  17. Torben Hansen commented on patch set 5 06/08/23, 07:59

    ObjectConverterTest.php:461 Reply

    Done

    ObjectConverterTest.php:473 Reply

    Done

    ObjectConverterTest.php:481 Reply

    Done
  18. Oliver Klee voted on patch set 6 V +1 CR +1 06/08/23, 08:06

  19. core-ci voted on patch set 6 V +1 06/08/23, 08:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42287

  20. Christian Kuhn voted on patch set 6 V +2 CR +2 06/08/23, 12:03

  21. Christian Kuhn merged patch set 7 06/08/23, 12:03