Review main Merged

51908[CLEANUP] Streamline Avatar-related code in EXT:backend

Benni Mack CR +2 V +2 Normal +52 −67 updated 03/03/17, 08:19

Commit message

- Add proper comments to all PHP code, remove all unnecessary
comments (e.g. "get height" for getHeight() method).
- Move Icon functionality to ViewHelpers instead of doing everything
in PHP.

Review

  • Code review CR +2
    • Benni Mack +2
    • Daniel Goerz +1
    • Georg Ringer +1
  • Verified V +2
    • Benni Mack +2
    • Daniel Goerz +1
    • Georg Ringer +1
    • TYPO3com +1 CI

Issues 1

Files 6

Review log 1013

  1. Benni Mack uploaded patch set 1 02/28/17, 19:54

  2. Josef Glatz commented on patch set 1 02/28/17, 19:58

    Avatar.php:26

    typo
  3. TYPO3com voted on patch set 1 V +1 02/28/17, 20:03 Completed build in 08m 58s on Tue, 28 Feb, 09:03 PM Test Summary: 56321 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8774

  4. Benni Mack commented on patch set 2 03/01/17, 05:32

    Published edit on patch set 1.
  5. TYPO3com voted on patch set 2 V +1 03/01/17, 05:42 Completed build in 09m 48s on Wed, 1 Mar, 06:42 AM Test Summary: 56321 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8780

  6. Thomas Hohn voted on patch set 2 CR +1 V +1 03/01/17, 05:44

  7. Daniel Goerz commented on patch set 3 03/01/17, 09:33

    Published edit on patch set 2.
  8. Daniel Goerz voted on patch set 3 CR +1 V +1 03/01/17, 09:33

  9. TYPO3com voted on patch set 3 V +1 03/01/17, 09:39 Completed build in 06m 07s on Wed, 1 Mar, 10:39 AM Test Summary: 56367 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8787

  10. Georg Ringer voted on patch set 3 CR +1 V +1 03/02/17, 19:07

  11. Benni Mack voted on patch set 3 CR +2 V +2 03/03/17, 07:58

  12. Gerrit merged patch set 3 03/03/17, 07:58

  13. Claus Due commented on patch set 4 03/03/17, 08:19

    Avatar.php:49

    I think it's time we assign this 32 as a constant (if we don't already have on that deals with icon sizes...) - then use that constant here and in the VH default argument value.

    Avatar.php:67

    If you refactor so instead of rendering the <img> tag we get an Image::class instance, the image tag can be rendered and thus manipulated in the template file (which is I think more appropriate especially if we allow override; see below). Looks like $this->getImage() gives the right object - and you can assign the default avatar image (uri) as template variable and put a condition in the template so it also becomes a way to replace the default avatar.

    Avatar.php:180

    These three lines can be replaced with $view->getRenderingContext()->getTemplatePaths()->fillDefaultsByPackageName('backend');

    Avatar.php:188

    This could be replaced by setting controller name and action name on RenderingContext. That would allow overrides of the template file.

    AvatarViewHelper.php:45

    This is where we could use the previously mentioned constant.