Review main Merged

64002[TASK] Refactor fluid page module components

Claus Due CR +2 V +2 Expert +682 −600 updated 04/20/20, 09:15

Commit message

Refactoring with the goal of:

* Restoring entity-like nature of BackendLayout
* Decreasing coupling between components of the page
  module processing and rendering.

Implements a PageLayoutContext to hold all context-related
objects and methods and passes the context to objects
instead of passing the BackendLayout. Reduces number of
methods on DrawingConfiguration so the configuration object
only holds output- and behavior-related options and does not
hold things like permission checks.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Hader +1
    • Susi Moog +1
  • Verified V +2 Done
    • Benni Mack +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 19

Review log 3544

Show 1319 earlier messages
  1. Claus Due uploaded patch set 1 03/30/20, 09:09

  2. TYPO3com voted on patch set 1 V -1 03/30/20, 09:09 Completed build in 24s on Mon, 30 Mar, 09:09 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1944

  3. Claus Due commented on patch set 1 03/30/20, 09:10

    Patch currently holds code related to fixing issues with -1 language content, and fluid templates are not yet fully refactored to access context information from the right variables.
  4. Claus Due uploaded patch set 2 03/30/20, 09:11

  5. TYPO3com voted on patch set 2 V -1 03/30/20, 09:23 Completed build in 11m 53s on Mon, 30 Mar, 09:23 AM Test Summary: 2 of 73210 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1945

  6. Claus Due uploaded patch set 3 03/30/20, 10:25

  7. Claus Due uploaded patch set 4 03/30/20, 10:38

  8. TYPO3com voted on patch set 3 V -1 03/30/20, 10:44 Completed build in 18m 36s on Mon, 30 Mar, 10:44 AM Test Summary: 73056 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1950

  9. TYPO3com voted on patch set 4 V -1 03/30/20, 10:53 Completed build in 14m 25s on Mon, 30 Mar, 10:53 AM Test Summary: 73056 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1951

  10. Claus Due uploaded patch set 5 04/14/20, 11:12

  11. Benni Mack voted on patch set 5 CR +1 04/14/20, 11:19

  12. Benni Mack commented on patch set 5 04/14/20, 11:19

    really nice work!
  13. TYPO3com voted on patch set 5 V -1 04/14/20, 11:23 Completed build in 11m 29s on Tue, 14 Apr, 11:23 AM Test Summary: 73457 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2484

  14. Claus Due uploaded patch set 6 04/14/20, 12:05

  15. TYPO3com voted on patch set 6 V -1 04/14/20, 12:05 Completed build in 22s on Tue, 14 Apr, 12:05 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2493

  16. Claus Due commented on patch set 6 04/14/20, 12:09

    Thanks Benni - should be better now in terms of decoupling, but the permissions part of the notes you provided hasn't been taken care of. If possible I would like to skip that until after LTS release, since that allows us a chance to refactor and integrate a "permissions check" set of objects in other areas as well. Once this patch is merged I will take care of https://review.typo3.org/c/Packages/TYPO3.CMS/+/63995 which should fix half of the issue described in https://forge.typo3.org/issues/90617. And when that is done I'll try to take care of the second half of that forge issue, the visual alignment of records when defLangBinding=true.
  17. Benni Mack commented on patch set 6 04/14/20, 12:09

    I agree on the permissions part. We need a proper API for that in general.
  18. Claus Due commented on patch set 6 04/14/20, 12:38

    Will rebase and resolve conflicts, looks like the "keep pid for versioned records" change touched some of this code as well.
  19. Claus Due uploaded patch set 7 04/14/20, 12:42

  1. TYPO3com voted on patch set 7 V +1 04/14/20, 12:54 Completed build in 12m 02s on Tue, 14 Apr, 12:54 PM Test Summary: 73472 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2499

  2. Benni Mack voted on patch set 7 V +1 CR +1 04/14/20, 14:22

  3. Benni Mack uploaded patch set 8 04/17/20, 07:44

  4. TYPO3com voted on patch set 8 V +1 04/17/20, 08:08 Completed build in 22m 24s on Fri, 17 Apr, 08:08 AM Test Summary: 73561 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2692

  5. Benni Mack commented on patch set 8 V -1 04/17/20, 12:36

    (1/1) TypeError Return value of TYPO3\CMS\Backend\View\PageLayoutContext::getLocalizedPageRecord() must be of the type array, bool returned in typo3/sysext/backend/Classes/View/PageLayoutContext.php line 379
  6. Claus Due commented on patch set 8 04/17/20, 12:43

    > Patch Set 8: Verified-1 > > (1/1) TypeError > Return value of TYPO3\CMS\Backend\View\PageLayoutContext::getLocalizedPageRecord() must be of the type array, bool returned > > in typo3/sysext/backend/Classes/View/PageLayoutContext.php line 379 Hi Benni - how can I reproduce this? Probably requires specific properties in the page record?
  7. Benni Mack commented on patch set 8 04/17/20, 12:44

    getLocalizedPageRecord() returns false, because there is no localized page record is my assumption. Only happens on some pages.
  8. Claus Due commented on patch set 8 04/18/20, 10:51

    > Patch Set 8: > > getLocalizedPageRecord() returns false, because there is no localized page record is my assumption. Only happens on some pages. 1) The previous state of code also called $this->pageRecord = BackendUtility::getRecordWSOL('pages', $pageId); without checking the return value, and the getter also returns the value without type check. 2) It is theoretically not possible for a language to exist, which doesn't have an overlay, but is still rendered as language column in the page module. Given (1) would it be reasonable to make a potential fix a separate BUGFIX? And given (2) I think I'll still need some additional info about how to reproduce, as the cause might be further up in the architecture, e.g. somehow rendering a language column that shouldn't be rendered. Fixing the return value probably just hides another problem...
  9. Benni Mack voted on patch set 8 V +1 CR +1 04/18/20, 12:27

  10. Susi Moog commented on patch set 8 V -1 04/19/20, 09:02

    First problem: New Page Module: if you have an all languages element it is now displayed, but: the translation wizard is also displayed along with it - triggering it results in an error after the steps as there is no actual element to translate. It works correctly in the "old" page module - both before and after the patch. Second problem: New page module: A page of type spacer throws the following exception: Return value of TYPO3\CMS\Backend\View\PageLayoutContext::getLocalizedPageRecord() must be of the type array, bool returned (this also works fine in the old one)
  11. Susi Moog commented on patch set 8 04/19/20, 09:04

    > Patch Set 8: Verified-1 > New page module: A page of type spacer throws the following exception: Return value of TYPO3\CMS\Backend\View\PageLayoutContext::getLocalizedPageRecord() must be of the type array, bool returned (this also works fine in the old one) Correction: this happens on all pages without a translation for me (intro package, root page translated, features translated, all others non-translated results in the exception on every non-translated page)
  12. Claus Due commented on patch set 8 04/19/20, 09:16

    > Correction: this happens on all pages without a translation for me (intro package, root page translated, features translated, all others non-translated results in the exception on every non-translated page) I'll take a look, but if this also happens without this refactoring patch I would suggest merging this and getting the bug fixed in a separate BUGFIX - not least for clarity!
  13. Claus Due uploaded patch set 9 04/19/20, 10:40

  14. Claus Due commented on patch set 9 04/19/20, 10:42

    Found the problem - the method for determining which languages to show was changed and the new method did not check for presence of translated versions and would indiscriminately show all installed languages instead of only those that had translations. I've also slightly refactored the localized record fetching to avoid multiple calls to resolve the localized record and skip the resolving for language zero.
  15. TYPO3com voted on patch set 9 V +1 04/19/20, 10:51 Completed build in 11m 24s on Sun, 19 Apr, 10:51 AM Test Summary: 73627 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2837

  16. Benni Mack voted on patch set 9 V +1 CR +1 04/19/20, 19:20

  17. Jonas Eberle commented on patch set 9 04/19/20, 20:32

    I am not testing towards anything specific. I would expect that functionality is still the same? If functionality changed, then maybe that is a win also? Changes noticed so far: (d/o/all = default/other/all language) (testing with a multi-column layout [bootstrap_package]) 1) Add content "d 1" Translate "d 1" to "o 1" Add content "d 2" Translate "d 2" to "o 2" (sorting: "d 2" is now before "d 1") Add content "d 3" Add content "all 1" Add content "all 2" (=> we are in connected mode) 1a) => before: "all *" is not shown in either view => now "all" is shown * for the "Languages" view in the column of the default language * for the "Columns" view in all languages (but the sorting in relation to the connected content can be wrong - I am still trying to figure out how to reproduce this) 1b) => before: not possible to add content to other language => now: it is possible in "columns" view 1c) => before: "Columns" view for other language did only show "o 1", "o 2" => now: "o 1" and "o 2" are shown with the flag of default language; then "all 1" and "all 2" are shown; Then in another column named equally as the orginal column "d 3" is also shown! Above the page the warning "Unused elements detected on this page" is shown
  18. Jonas Eberle commented on patch set 9 04/19/20, 20:55

    (by the way: Fallback type is Fallback: default language - but for these intra-column tests that should not have any effect) 2) Untranslate "o 1" (select Transl.Orig. = ) => we are now in mixed mode 2a) in "Column" view for other language: => before: same as in 1c) => now: "d 1" and "d 3" have now the additional-column-symptom from 1c) (so anything untranslated from the default language will be shown); flags as in 1c) 3) Untranslate "o 2" => we are now in free mode => before and now: same as in the other scenarios. Adding content for other language is possible.
  19. Jonas Eberle commented on patch set 9 04/19/20, 21:05

    3b) (still free mode) In "Languages" view: => before: dragging between languages is possible and the language of the content is changed; re-ordering in default or other language is possible => now: dragging is possible in the UI to all spots but the language gets always set to the default language (even when reordering within the "other language")
  20. Jonas Eberle commented on patch set 9 04/19/20, 21:17

    4) (connected mode) 4a) => before and now: dragging is not possible for other language in any view (as it should). => now: language for "all" gets reset to default language after reordering within the same column (duplicate of 3b I think and that also explains my initial wondering about sudden "all"->"default" language changes)
  21. Susi Moog commented on patch set 9 V +1 CR +1 04/20/20, 08:52

    While I think Jonas comments are valid, I'd opt for merging the basic refactoring as it is now and fix the remaining issues separately to allow us to move forward.
  22. Claus Due commented on patch set 9 04/20/20, 08:59

  23. Benni Mack commented on patch set 9 V +2 CR +2 04/20/20, 09:11

    @Jonas. Thanks for your analysis - I think we need to move forward and use your examples as perfect test cases for creating Unit, Functional and Acceptance Tests (the first one we can then do once this is in, as this makes mocking much easier).
  24. Benni Mack merged patch set 10 04/20/20, 09:11

  25. Oliver Hader commented on patch set 10 CR +1 04/20/20, 09:15

    Looks okay to me...