Review main Merged

69395[BUGFIX] Fix typed property access in ModuleTemplate

Oli Bartsch CR +2 V +2 Easy +4 −19 updated 06/09/21, 08:45

Commit message

When dumping the ModuleTemplate with DebuggerUtility
a property access exception is thrown, since the
FlashMessageQueue is neither initialized nor declared
as nullable.

This is fixed by initializing the FlashMessageQueue
in the constructor now. This instance can however
still be overwritten by the corresponding setter method.

Review

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

Issues 1

Files 2

Review log 1317

  1. Oli Bartsch uploaded patch set 1 06/04/21, 09:31

  2. core-ci voted on patch set 1 V +1 06/04/21, 09:43 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12154

  3. Oliver Klee voted on patch set 1 CR +1 06/04/21, 13:04

  4. Jochen Roth voted on patch set 1 V +1 CR +1 06/08/21, 07:40

  5. Christian Kuhn commented on patch set 1 06/08/21, 12:27

    The patch is of course correct. But wouldn't it be better to simply set FlashMessageQueue in __construct? The service is injected, so the call from protected getFlashMessageQueue could be done in __construct directly? This does not look like an expensive operation, right? getMessageQueueByIdentifier() does not seem to trigger db calls or something like that, so it would be fine to simply always get the queue? If that is correct, I'd probably change the patch accordingly. What do you think?
  6. Oli Bartsch commented on patch set 1 06/08/21, 13:36

    Reply

    Injecting the Queue as a general service doesn't seem right here, since there a some place which use the setter to add individual instances. See e.g. https://github.com/TYPO3/TYPO3.CMS/blob/5a4560909b86a5d1d90e617e0b6726254b9f8f70/typo3/sysext/backend/Classes/ViewHelpers/ModuleLayoutViewHelper.php#L93
  7. Oli Bartsch uploaded patch set 2 06/08/21, 14:19

  8. Oli Bartsch commented on patch set 2 06/08/21, 14:20

    Reply

    Done
  9. Oli Bartsch uploaded patch set 3 06/08/21, 14:24

  10. core-ci voted on patch set 2 V -1 06/08/21, 14:27 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12220

  11. core-ci voted on patch set 3 V -1 06/08/21, 14:33 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12221

  12. Oli Bartsch uploaded patch set 4 06/08/21, 14:41

  13. core-ci voted on patch set 4 V +1 06/08/21, 14:51 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12222

  14. Christian Kuhn voted on patch set 4 V +1 CR +1 06/08/21, 15:14

  15. Jochen Roth voted on patch set 4 V +1 CR +1 06/09/21, 08:41

  16. Christian Kuhn voted on patch set 4 V +2 CR +2 06/09/21, 08:45

  17. Christian Kuhn merged patch set 5 06/09/21, 08:45