Review main Merged

61519[BUGFIX] Set module state only if UC structure is intact

Andreas Kienast CR +2 V +2 Easy +9 −2 updated 08/23/19, 09:46

Commit message

In some scenarios it seems the UC of a backend user is malformed and
isn't structured as expected. To circumvent this issue, the UC is
encoded to a JSON string and immediately decoded to a plain array again.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Oliver Klee +1
    • Frank Nägler +1
    • Moritz Ngo +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Moritz Ngo +1
    • Tobias Wollender +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 2429

Show 34 earlier messages
  1. Andreas Kienast uploaded patch set 1 08/20/19, 12:53

  2. Richard Haeser voted on patch set 1 CR +1 08/20/19, 13:01

  3. TYPO3com voted on patch set 1 V +1 08/20/19, 13:04 Completed build in 11m 31s on Tue, 20 Aug, 01:04 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35747

  4. Andreas Kienast commented on patch set 1 CR -1 08/20/19, 13:16

    still broken
  1. Andreas Kienast uploaded patch set 2 08/20/19, 13:19

  2. TYPO3com voted on patch set 2 V -1 08/20/19, 13:30 Completed build in 10m 46s on Tue, 20 Aug, 01:30 PM Test Summary: 1 of 47570 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35749

  3. TYPO3com voted on patch set 2 V +1 08/20/19, 13:37 Completed build in 28m 16s on Tue, 20 Aug, 01:37 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35749

  4. Oliver Klee voted on patch set 2 CR +1 08/20/19, 19:24

  5. Markus Klein updated the commit message in patch set 3 08/20/19, 20:03

  6. TYPO3com voted on patch set 3 V +1 08/20/19, 20:13 Completed build in 10m 24s on Tue, 20 Aug, 08:13 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35751

  7. Oliver Klee voted on patch set 3 CR +1 08/20/19, 21:36

  8. Rémy DANIEL commented on patch set 3 CR -1 08/22/19, 07:27

    IMHO the fix, which finally prevents wrong uc type, should not be in the BackendController, but should be somewhere in \TYPO3\CMS\Core\Authentication\BackendUserAuthentication::backendSetUC() or \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::unpack_uc()
  9. Andreas Kienast commented on patch set 3 08/22/19, 07:39

    > Patch Set 3: Code-Review-1 > > IMHO the fix, which finally prevents wrong uc type, should not be in the BackendController, but should be somewhere in \TYPO3\CMS\Core\Authentication\BackendUserAuthentication::backendSetUC() or \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication::unpack_uc() I object here: this would be actually a heavy breaking change since some data relies to be stored as an object!
  10. Rémy DANIEL commented on patch set 3 08/22/19, 09:05

    In a uc of a TYPO3 6.2 instance, I found other cases in uc['BackendComponents']['States'] where states are StdClass and not an array: typo3-debug-console, Pagetree, typo3-navigationContainer, typo3-module-menu In the Pagetree controller, there is another way to "test" for the malformation of uc: see \TYPO3\CMS\Backend\Controller\Page\TreeController in line 184 : $this->expandedState = $backendUserConfiguration->get('BackendComponents.States.Pagetree'); if (is_object($this->expandedState) && is_object($this->expandedState->stateHash)) { $this->expandedState = (array)$this->expandedState->stateHash; } else { $this->expandedState = $this->expandedState['stateHash'] ?: []; } We see that 'BackendComponents.States.Pagetree' is not expected as an object. My point is: does each Controller or JS getting/storing values in uc will test for a potential wrong type of the values? Or is it preferable and possible to "fix" it at a higher level?
  11. Andreas Kienast commented on patch set 3 08/22/19, 09:34

    > My point is: does each Controller or JS getting/storing values in uc will test for a potential wrong type of the values? Or is it preferable and possible to "fix" it at a higher level? There are plans to streamline (=refactor) the whole UC thing, but that needs proper concepts.
  12. Pascal Querner commented on patch set 3 08/22/19, 14:07

    BackendController.php:210

    $collapseState === 'true' can no longer happen since Method getCollapseStateOfMenu returns boolean already.
  13. Pascal Querner wrote 08/22/19, 14:11

    Removed reviewer Pascal Querner.
  14. Andreas Kienast commented on patch set 3 08/22/19, 14:12

    BackendController.php:210 Reply Unresolved

    That's true, will fix accordingly
  15. Tobias Wollender voted on patch set 3 V +1 08/22/19, 14:12

  16. Andreas Kienast commented on patch set 4 08/22/19, 14:12

    Published edit on patch set 3.
  17. Moritz Ngo voted on patch set 4 V +1 CR +1 08/22/19, 14:15

  18. Tobias Wollender voted on patch set 4 V +1 08/22/19, 14:17

  19. Oliver Klee voted on patch set 4 CR +1 08/22/19, 14:30

  20. TYPO3com voted on patch set 4 V +1 08/22/19, 14:42 Completed build in 26m 10s on Thu, 22 Aug, 02:42 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35771

  21. Frank Nägler voted on patch set 4 CR +1 08/23/19, 09:29

  22. Frank Nägler commented on patch set 4 CR -1 08/23/19, 09:31

    on it
  23. Frank Nägler voted on patch set 4 CR +1 08/23/19, 09:37

  24. Anja Leichsenring voted on patch set 4 V +2 CR +2 08/23/19, 09:46

  25. Anja Leichsenring merged patch set 5 08/23/19, 09:46