Review main Merged

65114[BUGFIX] Reset Type Conversion Messages after usage

Benni Mack CR +2 V +2 Easy +18 −7 updated 08/04/20, 18:48

Commit message

PropertyMapper (which is a singleton) previously created a new
$messages instance every time "convert" was called.

This works for most cases, however when using "getMessages()"
only the last message was returned.

It would be very useful to keep the messages in place
until "resetMessages()" is called, which is used within each
action of the Extbase controller validation
to avoid some edge-case issues when using multiple actions on one request.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Oli Bartsch +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Oli Bartsch +1
    • Christian Kuhn +1
    • TYPO3com +1 CI

Issues 1

Files 4

Review log 1216

  1. Benni Mack uploaded patch set 1 07/25/20, 21:38

  2. TYPO3com voted on patch set 1 V -1 07/25/20, 21:50 Completed build in 12m 02s on Sat, 25 Jul, 09:50 PM Test Summary: 6 of 73417 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4254

  3. Christian Kuhn uploaded patch set 2 07/27/20, 17:46

  4. Christian Kuhn commented on patch set 2 CR -1 07/27/20, 17:50

    Ok, fixed the tests. However, they show the issue with this approach: We end up with a getter changing state, so getMessages() can't be called twice. This is kinda sorta unexpected and the exact thing the tests did not foresee. Not sure if this is really the way to go, guess it depends on how the PropertyMapper object is usable in real life projects?
  5. TYPO3com voted on patch set 2 V +1 07/27/20, 17:59 Completed build in 12m 43s on Mon, 27 Jul, 05:59 PM Test Summary: 72924 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4274

  6. Benni Mack commented on patch set 2 07/28/20, 21:14

    Indeed, this is a stupid solution. I think we should go with a "resetMessages()" call instead.
  7. Benni Mack uploaded patch set 3 07/28/20, 21:18

  8. TYPO3com voted on patch set 3 V +1 07/28/20, 21:32 Completed build in 14m 35s on Tue, 28 Jul, 09:32 PM Test Summary: 72924 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4294

  9. Oli Bartsch commented on patch set 3 CR +1 07/29/20, 06:15

    PropertyMapper.php:94

    Maybe also use $this->resetMessages() here?
  10. Benni Mack commented on patch set 3 07/29/20, 07:26

    PropertyMapper.php:94 Reply Unresolved

    nah, because initializeObject() is called right after the constructor. This would throw an error right after instantiating the PropertyMapper, as ->getMessages() expects a Result object as "$this->messages" already.
  11. Oli Bartsch uploaded patch set 4 07/29/20, 08:21

  12. TYPO3com voted on patch set 4 V +1 07/29/20, 08:33 Completed build in 12m 03s on Wed, 29 Jul, 08:33 AM Test Summary: 72924 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4297

  13. Oli Bartsch voted on patch set 4 V +1 CR +1 07/29/20, 08:40

  14. Christian Kuhn voted on patch set 4 V +1 CR +1 08/04/20, 10:00

  15. Anja Leichsenring voted on patch set 4 V +2 CR +2 08/04/20, 18:48

  16. Anja Leichsenring merged patch set 5 08/04/20, 18:48