Review main Merged

61906[BUGFIX] Provide UpgradeWizard for outdated be_users uc settings

Daniel Goerz CR +2 V +2 Normal +143 −0 updated 11/22/19, 09:37

Commit message

Backend users each have a serialized array of individual user
configuration, called "uc" persisted in the be_users table.
Before TYPO3 9.5, the structure of this configuration could sometimes
contain stdClass objects, which is no longer supported. Logging in as
a backend user with such an outdated "uc" array would then crash several
parts of the TYPO3 backend, because the BackendUserConfiguration class
will try to access an stdClass type configuration like an array.

An UpgradeWizard called "BackendUserConfigurationUpdate" is now
provided, which allows to update any outdated "uc" structure of all
backend users.

Review

  • Code review CR +2 Done
    • Tymoteusz Motylewski +2
    • Daniel Goerz +1
    • Markus Klein +1
    • Susi Moog +1
  • Verified V +2 Done
    • Tymoteusz Motylewski +2
    • Daniel Goerz +1
    • Markus Klein +1
    • TYPO3com +1 CI

Issues 3

Files 2

Review log 2230

Show 45 earlier messages
  1. Daniel Goerz uploaded patch set 1 10/08/19, 08:30

  2. Daniel Goerz voted on patch set 1 CR -1 10/08/19, 08:31

  3. Mathias Brodala commented on patch set 1 CR -1 10/08/19, 08:34

    BackendUserConfigurationUpdate.php:63

    It may not be the fastest but we could make sure to only process affected rows if we'd do a LIKE query for "stdClass" instead (including quotes). If there are rows, an update is necessary.

    BackendUserConfigurationUpdate.php:67

    This is potentially unsafe, you must explicitly allow unserialization of stdClass here: unserialize($backendUser['uc'], ['allowed_classes' => ['stdClass']]);

    BackendUserConfigurationUpdate.php:101

    For this basic query you could use Connection::select() instead.

    BackendUserConfigurationUpdate.php:104

    See above.

    BackendUserConfigurationUpdate.php:106

    If not used you can simply drop this argument.

    BackendUserConfigurationUpdate.php:121

    For this basic query you could use Connection::update() instead.
  4. Daniel Goerz commented on patch set 1 10/08/19, 08:35

    Patch was previously available here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61874
  5. TYPO3com voted on patch set 1 V +1 10/08/19, 08:40 Completed build in 10m 00s on Tue, 8 Oct, 08:40 AM Test Summary: 47719 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37132

  1. Jörg Bösche uploaded patch set 2 10/09/19, 11:39

  2. Jörg Bösche commented on patch set 2 10/09/19, 11:42

    BackendUserConfigurationUpdate.php:63 Reply

    Done

    BackendUserConfigurationUpdate.php:67 Reply

    Done

    BackendUserConfigurationUpdate.php:101 Reply

    Could not use Connection::select() because of LIKE statement. The connection select() method iterates over the statements and pushs the data to an equals() method. I did an extraction to a method to reuse the query in the "update necessary" and "executeUpdate" methods.

    BackendUserConfigurationUpdate.php:104 Reply

    Done

    BackendUserConfigurationUpdate.php:106 Reply

    Done

    BackendUserConfigurationUpdate.php:121 Reply

    Done
  3. Jörg Bösche uploaded patch set 3 10/09/19, 11:44

  4. TYPO3com voted on patch set 2 V -1 10/09/19, 11:51 Completed build in 11m 28s on Wed, 9 Oct, 11:51 AM Test Summary: 47216 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37174

  5. TYPO3com voted on patch set 3 V -1 10/09/19, 11:57 Completed build in 12m 34s on Wed, 9 Oct, 11:57 AM Test Summary: 1 of 48078 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37175

  6. TYPO3com voted on patch set 3 V +1 10/09/19, 12:16 Completed build in 18m 56s on Wed, 9 Oct, 12:16 PM Test Summary: 47719 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37178

  7. Mathias Brodala commented on patch set 3 CR -1 10/09/19, 12:38

    BackendUserConfigurationUpdate.php:64 Unresolved

    You can simply use foreach ($statement as $backendUser)

    BackendUserConfigurationUpdate.php:116 Unresolved

    You should use `Doctrine\DBAL\Driver\Statement` instead here, otherwise this will crash on any other DBMS.
  8. Jörg Bösche uploaded patch set 4 10/09/19, 13:18

  9. Mathias Brodala commented on patch set 5 10/09/19, 13:25

    Published edit on patch set 4.
  10. TYPO3com voted on patch set 5 V -1 10/09/19, 13:26 Completed build in 15s on Wed, 9 Oct, 01:26 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37185

  11. TYPO3com voted on patch set 4 V +1 10/09/19, 13:26 Completed build in 08m 00s on Wed, 9 Oct, 01:26 PM Test Summary: 47719 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37184

  12. Mathias Brodala commented on patch set 6 10/09/19, 13:27

    Published edit on patch set 5.
  13. Mathias Brodala voted on patch set 6 CR +1 10/09/19, 13:28

  14. TYPO3com voted on patch set 6 V +1 10/09/19, 13:38 Completed build in 11m 20s on Wed, 9 Oct, 01:38 PM Test Summary: 47719 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37186

  15. Markus Klein commented on patch set 6 10/14/19, 11:24

    BackendUserConfigurationUpdate.php:128 Unresolved

    This is not needed, since we specify the string ourselves
  16. Christian Eßl uploaded patch set 7 10/14/19, 15:31

  17. TYPO3com voted on patch set 7 V +1 10/14/19, 15:46 Completed build in 12m 43s on Mon, 14 Oct, 03:46 PM Test Summary: 47982 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37318

  18. Markus Klein voted on patch set 7 CR +1 10/14/19, 18:56

  19. Tymoteusz Motylewski commented on patch set 7 10/19/19, 19:51

    How this can be tested?
  20. Daniel Goerz voted on patch set 7 V +1 CR +1 10/21/19, 15:22

  21. Susi Moog voted on patch set 7 CR +1 10/28/19, 20:17

  22. Markus Klein commented on patch set 7 V +1 10/29/19, 15:16

    tested with an upgrade from v7 to v9
  23. Tymoteusz Motylewski voted on patch set 7 V +2 CR +2 10/29/19, 15:17

  24. Tymoteusz Motylewski merged patch set 8 10/29/19, 15:17

  25. Daniel Goerz commented on patch set 8 11/22/19, 09:37

    Pending BUGFIX for this UpgradeWizard: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62368