Uploaded image for project: 'Release Notes Application'
  1. Release Notes Application
  2. RN-82

All the videos of a change are displayed in the grid layout instead of only the first one

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.5
    • 2.3
    • Application
    • None
    • Integration
    • Unknown
    • N/A

    Description

      Problem

      In ReleaseNotes.Code.Change.ChangeDisplayerVelocityMacros, the displayScreenshots macro documents that when alwaysDisplayScreenshots is true it must "only display the 1st video if there are more than one". The guard meant to implement that tests $alwaysDisplayScreenshot – singular, missing the trailing "s" – which is never defined anywhere. An undefined reference evaluates to false in Velocity, so the #else branch always runs and every video is displayed.

      #if ($alwaysDisplayScreenshot && $videoReferences.size() > 0)
        #set ($computedVideoReferences = [$videoReferences.get(0)])
      #else
        #set ($computedVideoReferences = $videoReferences)
      #end
      

      The parameter name is spelled correctly in the other four places it appears in the same macro, so this is a plain typo rather than an intentional second flag.

      How to reproduce

      • Create a change with two video attachments and no screenshot, listing both in its screenshots field.
      • Render it with a displayer that passes alwaysDisplayScreenshots = true.
      • Expected: one video (the first). Actual: both videos.

      Verified on XWiki 18.6.0 with the grid displayer: the rendered card contains two <video> elements whether the parameter is true or false, so the parameter has no effect at all on the number of videos.

      Notes

      • Introduced by the fix for RN-67, so present since 2.3.
      • The grid displayer is currently the only caller passing true, which is why the deviation has gone unnoticed.
      • Fixing the typo changes rendering for any change carrying several videos and no screenshot, so it deserves its own issue rather than riding along with an unrelated change.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: