Hi (),

I seem to be itting a really weird bug.

In my request comps, I'm using attributes to set which link in the left
navigation to highlight. Since these can be hierarchical, the attribute
value is an arrayref of the names of the navigation e.g:

        navigation is:
                * Table of Contents
                * Chapter 1
                        * Section 1
                        * Section 2
                * Chapter 2
                        * Section 1
                etc


        chapter1_section1.html:
                <%attr>
                leftnav_selected => [ 'Chapter 1', 'Section 1' ]
                </%attr

        display_leftnav:
                ...

                $selected = $m->request_comp()->attr_if_exists( 
'leftnav_selected' );

                ...

                <ul>
                        <li<% $selected->[$level] eq $title ? ' 
class="selected"' : ''><% $title %></li>

I hope that all makes sense.

So this all works nicely and I get the correct navigation highlighted.
Most of the time. At random times *nothing* is highlighted. I've looked
at the Mason modules and nothing seems to be doing anything wrong.

I'm in a ModPerl2 environment, but I don't think that is the problem.

I'm managed to narrow it down tothe attributes not liking the arrayref.
When I change the leftnav_selected value to be a comma-seperated string,
I can't fault it. Could it be  When I change the leftnav_selected value
to be a comma-seperated string, I can't fault it.

Could this be a bug in the way _locate_inherited works with the double
ref in Component.pm?

Out of ideas,

Alfie

------------------------------------------------------------------------------
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to