[open-ils-commits] r12004 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jan 27 20:59:54 EST 2009


Author: miker
Date: 2009-01-27 20:59:53 -0500 (Tue, 27 Jan 2009)
New Revision: 12004

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/ModRunner.pm
Log:
allow either fleshed or unfleshed module objects

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/ModRunner.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/ModRunner.pm	2009-01-28 01:46:14 UTC (rev 12003)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/ModRunner.pm	2009-01-28 01:59:53 UTC (rev 12004)
@@ -7,12 +7,11 @@
     my $class = shift;
     $class = ref($class) || $class;
 
-    my $mod_thing = shift;
-    return undef unless ($mod_thing);
+    my $mod = shift;
+    return undef unless ($mod);
 
     my $self = bless {
-        mod_thing => $mod_thing,
-        module => $mod_thing->module(),
+        module => ref $mod ? $mod->module() : $mod,
         handler => 'handler'
     } => $class;
 
@@ -76,6 +75,15 @@
                 }
             } else {
                 $loaded = $m->use;
+
+                # The following is an escape hatch for builtin dummy handlers
+                if (!$loaded) {
+                    $loaded = $self->prefix->use;
+                    if ($loaded && $self->prefix->can( $self->module ) ) {
+                        $m = $self->prefix;
+                        $h = $self->module;
+                    }
+                }
             }
         } else {
             $m = $builtin_m;



More information about the open-ils-commits mailing list