Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-24683

Factorize the duplicated user-with-avatar display macro in likers.vm and getusers.vm

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 18.6.0
    • Like
    • None
    • Unknown

    Description

      `likers.vm` and `getusers.vm` each define their own local, identical `#displayUserAliasWithAvatar($userReference $disabled)` Velocity macro to render a user's avatar + link, instead of reusing the standard `displayUser` macro from `macros.vm`.

      This is a maintenance problem: the two templates carry duplicated markup/logic for something XWiki already has a shared, standard macro for. Any future change to how a user is displayed (permission handling, styling, accessibility, etc. — e.g. the non-viewable-user handling fixed in XWIKI-23995) has to be found and re-applied in both copies instead of being fixed once in `displayUser`. The local macros also lag behind `displayUser` in capability, since they were never touched when that macro evolved.

      This ticket is about eliminating that duplication so both templates go through the standard `displayUser` macro, with no visible change in how users are rendered in either template.

      Attachments

        Activity

          People

            Lucas C Charpentier Lucas
            Lucas C Charpentier Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: