Review main Merged

78339[TASK] Clean up avatar class

Christian Eßl CR +2 V +2 Easy +4 −11 updated 04/27/23, 12:56

Commit message

In a list of backend users, using the avatar viewhelper, the
instantiated Avatar class would always be the same instance.
Each time, getImage() is called, the avatar providers would be
initiated again, flooding the $avatarProviders variable with
superfluous providers. - Which meant, when rendering a list of
just 50 backend users, we suddenly have 1275 calls to the avatar
provider class, instead of just the expected 50.

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
    • Markus Klein +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Nikita Hovratov +2
    • Markus Klein +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2329

Show 34 earlier messages
  1. Christian Eßl uploaded patch set 1 03/31/23, 15:39

  2. Christian Eßl updated the commit message in patch set 2 03/31/23, 15:41

  3. core-ci voted on patch set 2 V +1 03/31/23, 15:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39909

  4. Nikita Hovratov commented on patch set 2 03/31/23, 15:50

    Avatar.php:120

    Please use `!== []` to avoid calling count method.
  1. Christian Eßl uploaded patch set 3 V +1 03/31/23, 15:54

  2. Christian Eßl commented on patch set 3 03/31/23, 15:54

    Avatar.php:120 Reply

    Done
  3. core-ci voted on patch set 3 V +1 03/31/23, 16:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39910

  4. core-ci voted on patch set 1 V +1 03/31/23, 16:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39908

  5. Markus Klein commented on patch set 3 CR +1 03/31/23, 19:15

    fix necessary for v11 too?
  6. Christian Kuhn commented on patch set 3 CR -1 04/01/23, 02:59

    Avatar.php:118

    put that into __construct() and skip the if().
  7. Christian Eßl uploaded patch set 4 CR +1 V +1 04/01/23, 08:56

  8. Christian Eßl commented on patch set 4 04/01/23, 08:56

    Avatar.php:118 Reply

    Done
  9. core-ci voted on patch set 4 V +1 04/01/23, 09:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39933

  10. Oli Bartsch commented on patch set 4 CR -1 04/03/23, 10:48

    DefaultAvatarProvider.php:40

    We should use the null coalescing operator here to prevent an undefined array key warning.
  11. Markus Klein voted on patch set 4 CR +1 04/03/23, 11:24

  12. Markus Klein commented on patch set 4 04/03/23, 11:26

    DefaultAvatarProvider.php:40 Reply

    IMO that's not strictly necessary here. If one passes an incomplete/invalid beuser "model" here, then a warning/error totally fine.
  13. Christian Eßl rebased onto patch set 5 CR +1 V +1 04/26/23, 09:42

  14. Christian Eßl commented on patch set 5 04/26/23, 09:45

    DefaultAvatarProvider.php:40 Reply

    I also think we can always safely assume, that a complete backend user array is passed here.
  15. core-ci voted on patch set 5 V +1 04/26/23, 09:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41245

  16. Andreas Kienast voted on patch set 5 V +1 CR +1 04/26/23, 09:50

  17. Markus Klein voted on patch set 5 V +1 CR +1 04/26/23, 10:08

  18. Christian Kuhn commented on patch set 5 CR -1 04/27/23, 10:44

    DefaultAvatarProvider.php:40 Reply

    don't add magic to the "count" field of relations: this field is notoriously outdated, there isn't even a "fixer" to update to current state. we should get rid of it entirely.
  19. Markus Klein commented on patch set 5 V 0 CR 0 04/27/23, 10:49

    DefaultAvatarProvider.php:40 Reply

    Oh... you are right of course. I totally missed that this is of course IRRE. I thought the fields holds the file uid directly.
  20. Christian Kuhn uploaded patch set 6 CR +1 V +1 04/27/23, 10:54

  21. Christian Kuhn commented on patch set 6 V +1 CR +1 04/27/23, 10:55

    DefaultAvatarProvider.php:40 Reply

    Done: Removed that hunk.
  22. Markus Klein voted on patch set 6 V +1 CR +1 04/27/23, 10:58

  23. core-ci voted on patch set 6 V +1 04/27/23, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41268

  24. Nikita Hovratov voted on patch set 6 V +2 CR +2 04/27/23, 12:56

  25. Nikita Hovratov merged patch set 7 04/27/23, 12:56