Review main Merged

61117[BUGFIX] Avoid storing Extbase reflection in be_users.uc

Oliver Hader CR +2 V +2 Easy +20 −16 updated 07/15/19, 07:30

Commit message

The backend users module (ext:beuser) persists previously defined
filter combinations in be_users.uc fields of the according user. When
a "user group" is defined in the filter, Extbase architecture internals
get serialized and persisted as well which has performance impacts and
most probably will exceed storage (16M) of be_users.uc field.

It is enough to store the uid of the according be_groups entity.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Daniel Goerz +1
    • Markus Klein +1
    • Alexander Schnitzler +1
    • Julian Geils +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Markus Klein +1
    • Alexander Schnitzler +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 2630

Show 45 earlier messages
  1. Oliver Hader uploaded patch set 1 06/21/19, 19:34

  2. TYPO3com voted on patch set 1 V +1 06/21/19, 19:47 Completed build in 12m 30s on Fri, 21 Jun, 09:47 PM Test Summary: 46478 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34504

  3. Georg Ringer voted on patch set 1 CR +1 06/22/19, 05:15

  4. Markus Klein commented on patch set 1 06/22/19, 08:46

    I cannot test this patch, because the beusers module fails on current master with PHP Warning: Invalid argument supplied for foreach() in /var/www/typo3_src/vendor/typo3fluid/fluid/src/Core/Parser/TemplateProcessor/NamespaceDetectionTemplateProcessor.php line 180 I have no clue what could be wrong at the moment (composer deps installed, caches flushed, etc)
  5. Oliver Hader commented on patch set 1 06/22/19, 09:19

    > Patch Set 1: > I have no clue what could be wrong at the moment (composer deps installed, caches flushed, etc) Could you debug at that line in case `!is_array($whatever)` (or use the stacktrace, if there's usable output)? Otherwise I guess, that cleaning be_users.uc might help here (which is exactly the topic of this patch)
  1. Markus Klein commented on patch set 1 06/22/19, 09:47

    > Patch Set 1: > > > Patch Set 1: > > I have no clue what could be wrong at the moment (composer deps installed, caches flushed, etc) > > Could you debug at that line in case `!is_array($whatever)` (or use the stacktrace, if there's usable output)? > Otherwise I guess, that cleaning be_users.uc might help here (which is exactly the topic of this patch) Nope, uc was cleared already. The reason was a bit "deeper": https://review.typo3.org/c/Packages/TYPO3.CMS/+/61119
  2. Markus Klein commented on patch set 1 V -1 06/22/19, 09:49

    1) use plan master 2) flush beuser.uc 3) Select any group in the filters and click "filter" 4) apply the patch 5) access the beusers module again `Call to a member function getDemand() on bool` in BackendUserController.php line 135
  3. Oliver Klee commented on patch set 1 06/22/19, 10:13

    post -> most
  4. Daniel Goerz commented on patch set 1 06/24/19, 08:12

    > Patch Set 1: > > (1 comment)
  5. Benjamin Franzke commented on patch set 1 07/09/19, 18:10

    > `Call to a member function getDemand() on bool` in BackendUserController.php line 135 The happens because ModuleDataStorageService doesn't check the return value of unserialize. We could simply ignore an invalid module configuration and start with a new one, if the current is invalid. Filter demands are non critical and can therefore be cleared (from my point of view). Will upload a patch for that.

    Demand.php:109

    We shouldn't add a dependency to a service into a prototype like this. We could simply switch to an int-property, as we only want to know, store *and* use the uid of the backend user group, not any other property of that model. Doing that we can avoid implementing \Serializable. Will upload a patch for that.
  6. Benjamin Franzke uploaded patch set 2 07/09/19, 18:10

  7. Benjamin Franzke updated the commit message in patch set 3 07/09/19, 18:12

  8. Benjamin Franzke commented on patch set 3 V +1 CR +1 07/09/19, 18:13

    Reply

    Done

    Demand.php:109 Reply

    Done
  9. TYPO3com voted on patch set 2 V +1 07/09/19, 18:24 Completed build in 13m 18s on Tue, 9 Jul, 08:24 PM Test Summary: 46734 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34867

  10. TYPO3com voted on patch set 3 V +1 07/09/19, 18:25 Completed build in 12m 42s on Tue, 9 Jul, 08:25 PM Test Summary: 46734 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34868

  11. Tymoteusz Motylewski commented on patch set 3 07/09/19, 21:46

    ModuleDataStorageService.php:54

    Would it be possible to replace serialize with json encode or will it make the change too big?
  12. Oliver Klee voted on patch set 3 CR +1 07/09/19, 21:47

  13. Jörg Bösche updated the commit message in patch set 4 07/10/19, 06:50

  14. TYPO3com voted on patch set 4 V +1 07/10/19, 07:03 Completed build in 12m 50s on Wed, 10 Jul, 09:03 AM Test Summary: 46734 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-34869

  15. Benjamin Franzke voted on patch set 4 V +1 CR +1 07/10/19, 07:41

  16. Markus Klein voted on patch set 4 V +1 CR +1 07/10/19, 10:32

  17. Benjamin Franzke commented on patch set 4 07/10/19, 11:52

    ModuleDataStorageService.php:54 Reply Unresolved

    Would theoretically be possible (by manually coping the data to/from the ModuleData and Demand objects), but there is one disadvantage regarding the backport: Switching to json would effectively clear the beuser filter settings for all backend users (because the prior serialization data is always invalid). The current patchset would only lead to a filter clearance if a usergroup was selected before. I'd prefer json_encode as well, but we should rather do that on master.
  18. Julian Geils voted on patch set 4 CR +1 07/12/19, 07:17

  19. Frank Nägler commented on patch set 4 07/12/19, 12:03

    ModuleDataStorageService.php:54 Unresolved

    Why @-operator for the unserialize command? Any concrete reasons?
  20. Daniel Goerz voted on patch set 4 CR +1 07/13/19, 20:07

  21. Alexander Schnitzler commented on patch set 4 07/15/19, 07:05

    I wonder how the migration to the new "format" will work. If I see correctly, we force users to reset their be_user.uc, don't we? And if so, isn't this quite breaking in 9.5 ad 8.7?
  22. Alexander Schnitzler commented on patch set 4 V +1 CR +1 07/15/19, 07:18

    > Patch Set 4: > > I wonder how the migration to the new "format" will work. If I see correctly, we force users to reset their be_user.uc, don't we? And if so, isn't this quite breaking in 9.5 ad 8.7? Never mind. I tested it, understand it and it works fine. From 15MB down to 14kb with just the filter setting reset.
  23. Benjamin Franzke voted on patch set 4 V +2 CR +2 07/15/19, 07:30

  24. Benjamin Franzke merged patch set 5 07/15/19, 07:30

  25. Oliver Hader commented on patch set 4 07/15/19, 07:30

    > Patch Set 4: > > I wonder how the migration to the new "format" will work. If I see correctly, we force users to reset their be_user.uc, don't we? And if so, isn't this quite breaking in 9.5 ad 8.7? Payload is stored in `$BE_USER->uc['moduleData']['tx_beuser']` thus only a part of the UC is affected.