[jifty-devel] Order of Component Roots in Jifty

dbaster at bigpond.net.au dbaster at bigpond.net.au
Fri Oct 27 06:28:45 EDT 2006


Hi there,
I have been writing a plugin for Jifty but found during testing that a component defined in the Plugin does not override an existing Jifty component.  After investigation, I found that Handler.pm loads the Plugin's component root below the Jifty component and the Application component roots.

I suggest that a Plugin's component root should be loaded above Jifty and Application so a Plugin does have the ability to overload an existing Mason component.

Here is the diff.  

Daryl



--- Handler.pm.a        2006-10-27 19:27:37.000000000 +1000
+++ Handler.pm  2006-10-27 19:27:11.000000000 +1000
@@ -133,7 +133,7 @@
     for my $plugin (Jifty->plugins) {
         my $comp_root = $plugin->template_root;
         next unless $comp_root;
-        push @{ $config{comp_root} }, [ ref($plugin)."-".Jifty->web->serial => $comp_root ];
+        unshift @{ $config{comp_root} }, [ ref($plugin)."-".Jifty->web->serial => $comp_root ];
     }

     # In developer mode, we want halos, refreshing and all that other good stuff.

__________________



More information about the jifty-devel mailing list