Review main Merged

61874[BUGFIX] Provide UpgradeWizard for outdated be_users uc settings

Christian Eßl CR +2 V +2 Normal +128 −0 updated 10/08/19, 08:31

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
    • Daniel Goerz +2
    • Jörg Bösche +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Jörg Bösche +1
    • TYPO3com +1 CI

Issues 3

Files 2

Review log 1216

  1. Christian Eßl uploaded patch set 1 10/02/19, 19:07

  2. TYPO3com voted on patch set 1 V -1 10/02/19, 19:17 Completed build in 09m 38s on Wed, 2 Oct, 07:17 PM Test Summary: 1 of 48118 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37019

  3. TYPO3com commented on patch set 1 10/02/19, 19:29 Completed build in 10m 25s on Wed, 2 Oct, 07:29 PM Test Summary: 47500 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37020

  4. TYPO3com commented on patch set 1 10/02/19, 19:41 Completed build in 09m 40s on Wed, 2 Oct, 07:41 PM Test Summary: 47220 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37021

  5. Oliver Klee commented on patch set 1 10/02/19, 19:44

    BackendUserConfigurationUpdate.php:2

    Please let's make this file strict.
  6. Christian Eßl uploaded patch set 2 10/02/19, 19:54

  7. Christian Eßl commented on patch set 1 10/02/19, 19:55

    BackendUserConfigurationUpdate.php:2 Reply

    Done
  8. TYPO3com voted on patch set 2 V +1 10/02/19, 20:04 Completed build in 09m 26s on Wed, 2 Oct, 08:04 PM Test Summary: 47759 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37022

  9. Daniel Goerz voted on patch set 2 CR +1 10/06/19, 20:15

  10. Jörg Bösche commented on patch set 2 10/07/19, 12:58

    Can someone provide an example "uc"-setting with the stdClass situation to migrate? It is hard to verify, if there is no example to test and run the upgrade wizard.
  11. Jörg Bösche commented on patch set 2 V +1 CR +1 10/08/19, 07:36

    Found an old backend user with stdClass data in my projects. The upgrade wizard works fine for me.
  12. Daniel Goerz voted on patch set 2 V +2 CR +2 10/08/19, 07:38

  13. Daniel Goerz merged patch set 3 10/08/19, 07:38

  14. Mathias Brodala commented on patch set 3 10/08/19, 07:47

    BackendUserConfigurationUpdate.php:63 Unresolved

    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 Unresolved

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

    BackendUserConfigurationUpdate.php:101 Unresolved

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

    BackendUserConfigurationUpdate.php:104 Unresolved

    See above.

    BackendUserConfigurationUpdate.php:106 Unresolved

    If not used you can simply drop this argument.

    BackendUserConfigurationUpdate.php:121 Unresolved

    For this basic query you could use Connection::update() instead.
  15. Daniel Goerz wrote 10/08/19, 08:00

    Created a revert of this change as Ief7c57d33f3e4b0c864403460ef1f1b53ca3f5b0
  16. Daniel Goerz commented on patch set 3 10/08/19, 08:31