Review main Abandoned

63486[BUGFIX] Load RSS data only if widget is to be displayed

Susi Moog CR 0 V 0 Easy +13 −2 updated 03/23/20, 15:06

Commit message

Dashboard widgets should not load data in their constructor, as that
is executed always (to display the short info etc. in the modal).

Initialization is now no longer done in the constructor.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 5

Review log 1416

  1. Susi Moog uploaded patch set 1 02/28/20, 17:22

  2. Georg Ringer voted on patch set 1 V +1 CR +1 02/28/20, 17:25

  3. TYPO3com voted on patch set 1 V +1 02/28/20, 17:32 Completed build in 10m 09s on Fri, 28 Feb, 05:32 PM Test Summary: 72051 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-805

  4. Oli Bartsch commented on patch set 1 V -1 02/28/20, 18:47

    With an empty dashboard the cache for boot widgets "t3news" and "t3securityAdvisories" gets generated and debugging showed that both `__construct` and `initializeView` get called one time.
  5. Oli Bartsch commented on patch set 1 02/28/20, 18:48

    > Patch Set 1: Verified-1 > > With an empty dashboard the cache for boot widgets "t3news" and "t3securityAdvisories" gets generated and debugging showed that both `__construct` and `initializeView` get called one time. This is because `AbstractWidget` calls `initializeView` in their `__construct`.
  6. Oli Bartsch uploaded patch set 2 02/28/20, 19:55

  7. Oli Bartsch commented on patch set 2 02/28/20, 20:00

    > Patch Set 1: > > > Patch Set 1: Verified-1 > > > > With an empty dashboard the cache for boot widgets "t3news" and "t3securityAdvisories" gets generated and debugging showed that both `__construct` and `initializeView` get called one time. > > This is because `AbstractWidget` calls `initializeView` in their `__construct`. The remove the `initializeView` from the `__construct` in `AbstractWidget` some other abstracts and the `T3GeneralInformation` must call it in either their `initializeView` overwrite or in the `renderWidgetContent` function.
  8. TYPO3com voted on patch set 2 V +1 02/28/20, 20:06 Completed build in 11m 29s on Fri, 28 Feb, 08:06 PM Test Summary: 72051 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-810

  9. Oli Bartsch commented on patch set 2 02/28/20, 20:25

    One problem I still have with this patch is that if one wants to implement his own widget and therefore overwrites the`renderWidgetContent` he must call `initializeView` by himself. Also if he implements his own `initializeView` function he must call the parent. Surely one should have a look on the actual implementation if he overwrites a function but maybe we should adjust the docs anyway.
  10. Daniel Siepmann commented on patch set 2 V +1 02/29/20, 07:15

    Would it make more sense to add an check whether initializeView() method exists, and call it? That way inherited classes would have no need to call it prior rendering. Or would that introduce to much "magic"?
  11. Susi Moog commented on patch set 2 02/29/20, 08:12

    > Patch Set 2: Verified+1 > > Would it make more sense to add an check whether initializeView() method exists, and call it? > > That way inherited classes would have no need to call it prior rendering. Or would that introduce to much "magic"? hmm. maybe it would make more sense to move the whole logic to renderWidgetContent (as that is part of the interface) or add initializeView to the interface and to abstractWidget. I dislike "magic" checks for methods without interface.
  12. Susi Moog commented on patch set 2 V -1 02/29/20, 08:17

    > Patch Set 2: > > > Patch Set 2: Verified+1 > > > > Would it make more sense to add an check whether initializeView() method exists, and call it? > > > > That way inherited classes would have no need to call it prior rendering. Or would that introduce to much "magic"? > > hmm. maybe it would make more sense to move the whole logic to renderWidgetContent (as that is part of the interface) or add initializeView to the interface and to abstractWidget. I dislike "magic" checks for methods without interface. Additionally, this is probably part of the discussion, on whether or not widgets should be allowed to completely render their own stuff. If that's meant to be restricted and has to be a fluid view always, we can take care of the initialisation - if not, then the user has to. --> let's wait for an opinion from Richard here, please.
  13. Oli Bartsch commented on patch set 2 02/29/20, 09:04

    > Patch Set 2: Verified-1 > > > Patch Set 2: > > > > > Patch Set 2: Verified+1 > > > > > > Would it make more sense to add an check whether initializeView() method exists, and call it? > > > > > > That way inherited classes would have no need to call it prior rendering. Or would that introduce to much "magic"? > > > > hmm. maybe it would make more sense to move the whole logic to renderWidgetContent (as that is part of the interface) or add initializeView to the interface and to abstractWidget. I dislike "magic" checks for methods without interface. > > Additionally, this is probably part of the discussion, on whether or not widgets should be allowed to completely render their own stuff. If that's meant to be restricted and has to be a fluid view always, we can take care of the initialisation - if not, then the user has to. > > --> let's wait for an opinion from Richard here, please. I like the idea moving it to renderWidgetContent. Thats the reason I already moved the initializeView call there in the AbstractWidget. This is exaclty the point where the content should be rendered if the widget is used on the dashboard. The other properties, needed for the Wizards are still available. But as you said we should wait for Richards opinion on how much widgets should be restricted. See also Richards comment in this patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/63398
  14. Susi Moog commented on patch set 2 03/02/20, 13:08

    We should in general take another deep look at the API for widgets - I'm currently slightly unhappy with the interfaces / abstract combination.
  15. Daniel Siepmann commented on patch set 2 03/10/20, 06:50

    See https://review.typo3.org/c/Packages/TYPO3.CMS/+/63563 for changed to the API. Right now that proposal removed the initializeView() method and moves information gathering to renderWidgetContent().
  16. Susi Moog abandoned the change 03/23/20, 15:06

    see Daniels link to the other review