Review main Merged

61442[FEATURE] New PSR-14 events in the PageLayoutView class

Volker Kemeter CR +2 V +2 Hard +326 −4 updated 01/24/20, 10:56

Commit message

Two new PSR-14 events are added in the PageLayoutView class.
Those events can be used to add content into any column of a
BackendLayout. You can use this for example to show some
content in a column without a colPos assigned.

Review

  • Code review CR +2 Done
    • Richard Haeser +2
    • Daniel Siepmann +1
    • Jörg Bösche +1
    • Steffen Frese +1
  • Verified V +2 Done
    • Richard Haeser +2
    • Jörg Bösche +1
    • Steffen Frese +1
    • TYPO3com +1 CI

Issues 1

Files 8

Review log 4765

Show 2740 earlier messages
  1. Volker Kemeter uploaded patch set 1 08/05/19, 13:24

  2. TYPO3com voted on patch set 1 V -1 08/05/19, 13:26 Completed build in 42s on Mon, 5 Aug, 01:26 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35589

  3. Volker Kemeter uploaded patch set 2 08/05/19, 13:30

  4. Daniel Siepmann commented on patch set 2 CR -1 08/05/19, 13:32

    PageLayoutViewDrawEmptyColposContent.php:40

    I like the idea to have a default implementation. As this might not be replaced by all integrators, I would like to remove the part "You can now fetch Data from somewhere else and display it right in this position."

    PageLayoutViewDrawEmptyColposContent.php:46

    Not sure about this part ;)
  5. Mathias Brodala commented on patch set 2 CR -1 08/05/19, 13:34

    AfterGeneratedColposMarkupEvent.php:27

    This should be "AfterSectionMarkupGeneratedEvent". ColPos is only a means to fill backend layout sections.

    PageLayoutView.php:1202

    This should be "$event".

    PageLayoutView.php:4238 Unresolved

    Shouldn't we use the new DI instead?

    PageLayoutViewDrawEmptyColposContent.php:48

    Please remove the trailing whitespace.
  6. TYPO3com voted on patch set 2 V +1 08/05/19, 13:45 Completed build in 14m 31s on Mon, 5 Aug, 01:45 PM Test Summary: 47171 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35590

  7. Volker Kemeter uploaded patch set 3 08/05/19, 16:56

  8. TYPO3com voted on patch set 3 V -1 08/05/19, 16:56 Completed build in 20s on Mon, 5 Aug, 04:56 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35603

  9. Volker Kemeter uploaded patch set 4 08/05/19, 16:57

  10. TYPO3com voted on patch set 4 V -1 08/05/19, 16:58 Completed build in 13s on Mon, 5 Aug, 04:58 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35604

  11. Volker Kemeter uploaded patch set 5 08/05/19, 17:00

  12. TYPO3com voted on patch set 5 V +1 08/05/19, 17:10 Completed build in 09m 49s on Mon, 5 Aug, 05:10 PM Test Summary: 47172 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35605

  13. Volker Kemeter commented on patch set 5 08/06/19, 08:32

    > Patch Set 2: Code-Review-1 > > (2 comments)

    AfterGeneratedColposMarkupEvent.php:27 Reply

    i renamed then method, but i think, that this name is also not clear enough, because you are able to enrich content in the columns showed in the backend layout. maybe we should name it to "AfterColumnMarkupGeneratedEvent" or something similar. but i am absolutly fine with that name, too.

    PageLayoutView.php:1202 Reply

    i renamed that.

    PageLayoutViewDrawEmptyColposContent.php:40 Reply

    i totally agree and i already removed that.

    PageLayoutViewDrawEmptyColposContent.php:46 Reply

    i removed that, too.

    PageLayoutViewDrawEmptyColposContent.php:48 Reply

    Done
  14. Susi Moog commented on patch set 5 10/25/19, 21:47

    can you rebase / resolve the merge conflict here?
  15. Richard Haeser commented on patch set 5 12/16/19, 13:49

    Is there a reason this only gives you the possibility to interact at the bottom of the column? Why not in on top as well?
  16. Richard Haeser commented on patch set 5 CR -1 12/16/19, 14:11

    Feature-88921-NewEventInThePageLayoutViewClassToEnrichContentIntoTheColumnsInTheBackendLayout.rst:4

    Wrong title

    Feature-88921-NewEventInThePageLayoutViewClassToEnrichContentIntoTheColumnsInTheBackendLayout.rst:7

    Wrong issue number
  17. Richard Haeser commented on patch set 5 12/16/19, 14:21

    Services.yaml:20 Unresolved

    Do we want this listener by default? Or is this just an example?
  18. Richard Haeser uploaded patch set 6 12/16/19, 14:30

  19. Richard Haeser commented on patch set 6 12/16/19, 14:31

    Feature-88921-NewEventInThePageLayoutViewClassToEnrichContentIntoTheColumnsInTheBackendLayout.rst:4 Reply

    Done

    Feature-88921-NewEventInThePageLayoutViewClassToEnrichContentIntoTheColumnsInTheBackendLayout.rst:7 Reply

    Done
  20. TYPO3com voted on patch set 6 V -1 12/16/19, 14:37 Completed build in 07m 15s on Mon, 16 Dec, 02:37 PM Test Summary: 58674 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39458

  21. Richard Haeser uploaded patch set 7 12/16/19, 14:58

  22. TYPO3com voted on patch set 7 V +1 12/16/19, 15:05 Completed build in 07m 30s on Mon, 16 Dec, 03:05 PM Test Summary: 68774 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39459

  23. Richard Haeser uploaded patch set 8 12/16/19, 15:17

  24. Richard Haeser updated the commit message in patch set 9 12/16/19, 15:18

  25. TYPO3com voted on patch set 8 V +1 12/16/19, 15:27 Completed build in 09m 55s on Mon, 16 Dec, 03:27 PM Test Summary: 68774 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39462

  26. TYPO3com voted on patch set 9 V +1 12/16/19, 15:30 Completed build in 10m 23s on Mon, 16 Dec, 03:30 PM Test Summary: 68774 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39463

  27. Richard Haeser uploaded patch set 10 12/16/19, 21:06

  28. TYPO3com voted on patch set 10 V -1 12/16/19, 21:18 Completed build in 11m 11s on Mon, 16 Dec, 09:18 PM Test Summary: 6 of 69224 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39465

  29. Richard Haeser uploaded patch set 11 12/16/19, 21:29

  30. TYPO3com voted on patch set 11 V +1 12/16/19, 21:44 Completed build in 11m 16s on Mon, 16 Dec, 09:44 PM Test Summary: 68773 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39466

  31. Oli Bartsch commented on patch set 11 12/17/19, 06:40

    AfterSectionMarkupGeneratedEvent.php:54

    Could we get a type hint please.

    AfterSectionMarkupGeneratedEvent.php:66

    Maybe add the comment in the PHPDoc so IDEs can display them on calling this method? Same for `BeforeSectionMarkupGeneratedEvent`.

    BeforeSectionMarkupGeneratedEvent.php:54

    Could we get a type hint please.
  32. Daniel Siepmann commented on patch set 11 CR -1 12/17/19, 07:27

    AfterSectionMarkupGeneratedEvent.php:24

    "The" comes twice at end of this line and beginning of next line.

    BeforeSectionMarkupGeneratedEvent.php:24

    "The" comes twice at end of this line and beginning of next line.
  33. Daniel Siepmann uploaded patch set 12 12/17/19, 07:32

  34. Daniel Siepmann commented on patch set 12 CR +1 12/17/19, 07:33

    AfterSectionMarkupGeneratedEvent.php:24 Reply

    Done

    AfterSectionMarkupGeneratedEvent.php:54 Reply

    Done

    AfterSectionMarkupGeneratedEvent.php:66 Reply

    Done

    BeforeSectionMarkupGeneratedEvent.php:24 Reply

    Done

    BeforeSectionMarkupGeneratedEvent.php:54 Reply

    Done
  35. TYPO3com voted on patch set 12 V +1 12/17/19, 07:48 Completed build in 14m 46s on Tue, 17 Dec, 07:48 AM Test Summary: 68772 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39470

  36. Richard Haeser uploaded patch set 13 12/17/19, 21:02

  37. TYPO3com voted on patch set 13 V +1 12/17/19, 21:12 Completed build in 09m 38s on Tue, 17 Dec, 09:12 PM Test Summary: 69296 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39492

  38. Daniel Siepmann commented on patch set 13 CR -1 12/17/19, 22:19

    BeforeSectionMarkupGeneratedEvent.php:40

    Should we provide the whole record? We have the array already inside `$this->pageRecord` when creating the Event. This would provide all page info already and makes it obsolete to fetch the record again. But I would also understand if we would say to serve the necessary stuff and keep things simple within the code base. Same goes for 2nd Event.

    PageLayoutViewDrawEmptyColposContent.php:26

    This check is dangerous. There is no defined behaviour, there can also be an colPos defined with empty value. TYPO3 right now checks both. In order to keep the behaviour I would also keep the same logic here.

    PageLayoutViewDrawEmptyColposContent.php:44

    Right now TYPO3 has no way to replace events. Of course one can define his own listener before this one and call `$event->setStopRendering(true);`. Would it be better to use: `$event->setContent($event->getContent() . $content);` instead? Otherwise we might overwrite whatever the developer defines, depending on load order.
  39. Daniel Siepmann uploaded patch set 14 12/17/19, 22:19

  40. Daniel Siepmann commented on patch set 14 V +1 CR +1 12/17/19, 22:20

    PageLayoutViewDrawEmptyColposContent.php:26 Reply

    Done
  1. TYPO3com voted on patch set 14 V +1 12/17/19, 22:27 Completed build in 07m 33s on Tue, 17 Dec, 10:27 PM Test Summary: 69296 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39495

  2. Richard Haeser uploaded patch set 15 12/20/19, 07:36

  3. TYPO3com voted on patch set 15 V -1 12/20/19, 07:36 Completed build in 19s on Fri, 20 Dec, 07:36 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39540

  4. Richard Haeser uploaded patch set 16 12/20/19, 07:37

  5. TYPO3com voted on patch set 16 V +1 12/20/19, 07:47 Completed build in 09m 21s on Fri, 20 Dec, 07:47 AM Test Summary: 69128 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39541

  6. Richard Haeser commented on patch set 16 12/20/19, 07:58

    BeforeSectionMarkupGeneratedEvent.php:40 Reply

    I changed this, because in my usecase I also found out that having the complete PageLayoutView object is useful to have.

    PageLayoutViewDrawEmptyColposContent.php:44 Reply

    Done
  7. Daniel Siepmann commented on patch set 16 CR -1 12/20/19, 08:13

    AbstractSectionMarkupGeneratedEvent.php:58

    I would prefer to no longer follow the old behaviour to provide full classes with changing public properties in the future. Instead I would keep the old idea to provide getters for expected information. Still we can use the parent class within the event, as both are TYPO3 core, but only expose page uid and array of page properties? That would make the events more robust for the future, and allows developers to use the event, without the need to check public properties of the PageLayoutView.

    PageLayoutView.php:4196

    Shouldn't we add type hints to this arguments?

    PageLayoutViewDrawEmptyColposContent.php:26

    If no property colPos is defined, this will result in: PHP Notice: Undefined index Therefore I added the isset check. That's the same behaviour as done by TYPO3 already inside of this loop: https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/View/PageLayoutView.php#L1151
  8. Richard Haeser commented on patch set 16 12/20/19, 09:53

    AbstractSectionMarkupGeneratedEvent.php:58 Reply Unresolved

    I'm in favour of not sending unnecessary data. In our use-case of these events we use the tt_content_drawItem method of the PageLayoutView to show a preview of "inherited" content. That is why you can definitely use the PageLayoutView here. Would you prefer having a separate variable for the page id? and what about the colpos in that case?

    PageLayoutViewDrawEmptyColposContent.php:26 Reply

    Don't know where that was gone. You are completely right! Will fix that
  9. Richard Haeser uploaded patch set 17 12/20/19, 09:53

  10. Richard Haeser commented on patch set 17 12/20/19, 09:58

    PageLayoutView.php:4196 Reply

    Done

    PageLayoutViewDrawEmptyColposContent.php:26 Reply

    Done
  11. TYPO3com voted on patch set 17 V +1 12/20/19, 10:12 Completed build in 12m 08s on Fri, 20 Dec, 10:12 AM Test Summary: 69128 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39549

  12. Jörg Bösche uploaded patch set 18 01/15/20, 13:38

  13. TYPO3com voted on patch set 18 V +1 01/15/20, 14:04 Completed build in 25m 59s on Wed, 15 Jan, 02:04 PM Test Summary: 69527 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-39974

  14. Jörg Bösche commented on patch set 18 V +1 CR +1 01/15/20, 14:06

    Works for me on v10.3.0-dev. Only added declare strict.
  15. Daniel Siepmann voted on patch set 18 CR +1 01/15/20, 21:21

  16. Richard Haeser commented on patch set 18 01/15/20, 21:33

    Just checking current state
  17. Richard Haeser commented on patch set 18 V +1 CR +1 01/15/20, 21:44

    As I've written most of the code, some more reviews would be awesome.
  18. Steffen Frese voted on patch set 18 CR +1 01/17/20, 07:07

  19. Steffen Frese voted on patch set 18 V +1 01/17/20, 08:06

  20. Tobi Kretschmann commented on patch set 18 V -1 CR -1 01/17/20, 09:11

    the after event works fine. But if I try to invoke the "before" event, it doesn't work anymore. I am not sure if I just tested it wrong, but what I found is, that the \TYPO3\CMS\Backend\View\PageLayoutViewDrawEmptyColposContent only invokes the "after" event.
  21. Richard Haeser commented on patch set 18 01/21/20, 19:32

    > Patch Set 18: Verified-1 Code-Review-1 > > the after event works fine. > But if I try to invoke the "before" event, it doesn't work anymore. > I am not sure if I just tested it wrong, but what I found is, that the \TYPO3\CMS\Backend\View\PageLayoutViewDrawEmptyColposContent only invokes the "after" event. What exactly are you trying? I have an own extension that uses both before and after events and is working correctly. The PageLayoutViewDrawEmptyColposContent works only on after event because of the declaration in the services.yaml and the AfterSectionMarkupGeneratedEvent as the type of the parameter in the __invoke method.
  22. Tobi Kretschmann voted on patch set 18 V 0 CR 0 01/24/20, 10:48

  23. Richard Haeser commented on patch set 18 01/24/20, 10:55

    > Patch Set 18: -Verified -Code-Review Discussed with Tobi on Slack. The way events work was not completely clear by Tobi, so that's why the -1 is revoked. As other people already successfully tested it, I will merge this patch.
  24. Richard Haeser voted on patch set 18 V +2 CR +2 01/24/20, 10:56

  25. Richard Haeser merged patch set 19 01/24/20, 10:56