Struts Menu
  1. Struts Menu
  2. SM-77

Closing </ul> tag not matching in CSSListMenuDisplayer when Menu item doesn't have children allowed to view

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.2
    • Fix Version/s: 2.4.3
    • Component/s: Displayers
    • Labels:
      None

      Description

      In CSSListMenuDisplayer when top level menu item has childer but none of them is allowed to be displayed
      only ending </ul> tag is printed which leads to corrupted HTML output.

      This is caused by the fact that when printing starting tag <ul> there is a check:
      if (hasViewableChildren(menu))

      { out.println("\t\t<ul>"); }

      but ending tag </ul> is not guarded:
      // close the </ul> for the top menu
      if (level == 0)

      { out.println("</ul>"); }

        Activity

        Hide
        tomek ma?kowski added a comment -

        line 74 in CSSListMenuDisplayer should look:
        if (level == 0 && hasViewableChildren(menu)) {

        Show
        tomek ma?kowski added a comment - line 74 in CSSListMenuDisplayer should look: if (level == 0 && hasViewableChildren(menu)) {
        Hide
        Matt Raible added a comment -

        Fixed in CVS. Thanks for the fix!

        Show
        Matt Raible added a comment - Fixed in CVS. Thanks for the fix!

          People

          • Assignee:
            Matt Raible
            Reporter:
            tomek ma?kowski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: