[Jifty-commit] r6685 - in jifty/trunk: lib/Jifty/Web

Jifty commits jifty-commit at lists.jifty.org
Fri Mar 20 16:03:43 EDT 2009


Author: alexmv
Date: Fri Mar 20 16:03:43 2009
New Revision: 6685

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web/Menu.pm

Log:
 r43443 at kohr-ah:  chmrr | 2009-03-20 12:31:56 -0400
 Fix for URLS relative to their parents in menus


Modified: jifty/trunk/lib/Jifty/Web/Menu.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Menu.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Menu.pm	Fri Mar 20 16:03:43 2009
@@ -157,16 +157,20 @@
         # Clear children ordering cache
         delete $self->{children_list};
 
-        $self->{children}{$key} = $proto->new({parent => $self,
-                                               sort_order => ($self->{children}{$key}{sort_order}
-                                                          || scalar values %{$self->{children}}),
-                                               label => $key,
-                                               escape_label => 1,
-                                               @_
-                                             });
+        # Set us up the child
+        my $child = $proto->new({parent => $self,
+                                 sort_order => ($self->{children}{$key}{sort_order}
+                                                    || scalar values %{$self->{children}}),
+                                 label => $key,
+                                 escape_label => 1,
+                                 @_
+                             });
+        $self->{children}{$key} = $child;
+
+        # URL is relative to parents, and cached, so set it up now
+        $child->url($child->{url});
         
         # Figure out the URL
-        my $child = $self->{children}{$key};
         my $url   =   ( defined $child->link
                     and ref $child->link
                     and $child->link->can('url') )


More information about the Jifty-commit mailing list