Issue Details (XML | Word | Printable)

Key: SM-57
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Matt Raible
Reporter: Tomislav Stojcevich
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Struts Menu

CSSListMenu produces invalid XHTML when a submenu contains items for which the user has no permissions to see

Created: 08/Sep/06 11:48 AM   Updated: 18/Oct/06 01:11 PM   Resolved: 17/Oct/06 05:33 PM
Component/s: Displayers
Affects Version/s: 2.4.1
Fix Version/s: 2.4.2


 Description  « Hide
I have a submenu that contains items where a some users don't have permissions to see any of them although they do have permissions to see the submenu itself.
The generated code produces empty ul tags (<ul></ul>).
Validating this against xhtml 1.0 Strict give the following error:
end tag for "ul" which is not finished.

Sort Order: Ascending order - Click to sort in descending order
Matt Raible added a comment - 17/Oct/06 06:28 AM
Can you provide a more detailed example? I'd like to try and reproduce this in order to fix it. Are you using the Java or Velocity version of the CSSListMenu?

Tomislav Stojcevich added a comment - 17/Oct/06 08:28 AM
Using the java version.

In the menu-config I have something like:

<Menu name="level1Menu" title="Level1" location="/test/page1.do">
    <Item name="level2Menu" title="Level2" page="/test/page2.do">
        <Item name="level3MenuEntrya" title="Level3a" page="/test/page3a.do" roles="ROLE_A"/>
        <Item name="level3MenuEntryb" title="Level3b" page="/test/page3b.do" roles="ROLE_A"/>
    </Item>
</Menu>

No roles on level1 and level2 menu so everybody gets level1 and it contains the level2 menu.
Both level3 entries have a role specified so only people in ROLE_A see the level3 entries for the level2 menu. Users without ROLE_A don't get the level3 entries.

The html that gets produces for a non ROLE_A user is empty UL tags for level3 nested in the level2 li.


<li class="menubar">
    <a href="/test/page1.do">Level1</a>
    <ul>
        <li class="menubar">
            <a href="/test/page2.do">Level2</a>
            <ul>
            </ul>
        </li>
    </ul>
</li>

Matt Raible added a comment - 17/Oct/06 05:21 PM
I've been able to solve this one in the Velocity template, but I'm having a hard time in the Java version. If you figure it out by patching CSSListMenuDisplayer, please let me know.

Tomislav Stojcevich added a comment - 18/Oct/06 07:54 AM
I tried to fix it by buffering the output instead of writing it out directly and then testing for any content before writing out the <ul>. Due to the reflexive nature of the code, it wasn't so easy. The output kept coming out incorrect.
If I have time I'll try it again.

Matt Raible added a comment - 18/Oct/06 10:26 AM
I managed to fix it shortly after posting the comment yesterday. Have you tried the latest code from CVS? I hope to do a release in the next hour or two.

Tomislav Stojcevich added a comment - 18/Oct/06 10:56 AM
Can't get the latest code from CVS because i'm behind a proxied firewall at work. cvsgrab 2.2.2 (latest version) doesn't support viewcvs 1.0.1 using by this cvs repo.
Have to wait till I get home tonight. Or, if you put the jar somewhere i can download it, i'll be happy to test/check it.

Matt Raible added a comment - 18/Oct/06 01:11 PM