Review main Merged

81701[BUGFIX] Show correct icon for page types in UserInformationService

Achim Fritz CR +2 V +2 Easy +1 −1 updated 11/09/23, 09:10

Commit message

The page types section of the Compare User View now
displays the correct record type icon, which is already
resolved from the record type items definition.

Additionally, a fallback is added to prevent
a possible undefined array key warning.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 79

  1. Achim Fritz uploaded patch set 1 11/07/23, 12:06

  2. core-ci voted on patch set 1 V +1 11/07/23, 12:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48687

  3. Garvin Hicking commented on patch set 1 11/07/23, 15:30

    Thanks for providing a fix to the issue you find, I hope my comment is useful (couldn't try it out myself though)
    Maybe a bit too short, suggestion: [BUGFIX] Use fallback page icon when no doktype icon is defined ?
    Suggestion: The page types section of the User Detail View in the BackendUsers Module showed a PHP warning, in case no icon was defined for a page type. This fix uses the proper fallback chain to resolve the icon to a default (apps-pagetree-page-default).

    UserInformationService.php:234

    Dropping the lookup to `mapRecordTypeToIconIdentifier` doesn't seem right to me at this point? That method actually has a fallback to return `getDefaultIconIdentifier`. It seems to me (not verified) that $specialItem['icon'] is unset and yields the error message, so have you maybe tried this instead: ``` $icon = $this->iconFactory->mapRecordTypeToIconIdentifier('pages', ['doktype' => ($specialItem['icon'] ?? '')]); ``` Having an empty string then could maybe resolve the fallback properly, but also still utilize mapping usual records types?
  4. Oli Bartsch updated the commit message in patch set 2 V +1 11/08/23, 17:57

  5. Oli Bartsch updated the commit message in patch set 3 11/08/23, 17:57

  6. Oli Bartsch commented on patch set 3 V +1 CR +1 11/08/23, 17:57

    Reply

    Done

    Reply

    Done

    UserInformationService.php:234 Reply

    The $specialItem['icon'] already contains the correct icon identifier. Passing this value as "doktype" leads to the fact that the method will always fall back to the default icon. This means, dropping the method is the right fix IMO.
  7. core-ci voted on patch set 3 V +1 11/08/23, 18:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48728

  8. Benni Mack voted on patch set 3 V +2 CR +2 11/09/23, 09:10

  9. Benni Mack merged patch set 4 11/09/23, 09:10