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

Invalid HTML in the support plans dropdown of the Extension Manager

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      1. Start a fresh XWiki Standard instance (with the default remote extension repositories).
      2. Wait about 30 seconds so that the remote extension data is available, then open the Extension Manager (Administration > Extensions, or the XWiki.Extensions page).
      3. Validate the HTML of the page, for example with the Nu HTML5 validator.

      Result

      When an extension listed has a supporter offering several support plans (for example XWiki SAS), its support plans are rendered as a dropdown whose dialog is a div (holding an h4 title) placed inside a span:

      <span class="supporter support-multi-plan dropdown">
        <button class="supporter-name support-multi-name" data-toggle="dropdown" ...>XWiki SAS <span class="caret"></span></button>
        <div class="support-dialog dropdown-menu">
          ...
          <h4>Support plans</h4>
          <div class="support-flex">...</div>
        </div>
      </span>
      

      This is invalid HTML5 ("Element div not allowed as child of element span in this context"), reported once per such extension.

      The markup comes from the #displayExtensionSupportPlans macro of templates/extension.vm: the supporter element is a span when the macro is called with $supporterList set to false (the Extension Manager listing and extension pages), while the multi-plan branch always outputs a div dropdown inside it.

      Expected

      The support plans display is valid HTML5, whatever the number of plans.

      Notes

      Found while converting the web standards functional tests (xwiki-platform-distribution-flavor-test-webstandards) to JUnit 5: a first version of the converted tests ran XWiki with the default extension repositories, so the Extension Manager pages listed remote extensions with their support plans. The web standards tests normally run without any extension repository, which is why they never saw this markup.

      Attachments

        1. XWIKI-25628-after.png
          103 kB
          Vincent Massol
        2. XWIKI-25628-before.png
          106 kB
          Vincent Massol

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: