From 7216c3c0d28a086a5b0a3ab4f4054a730e5cd87a Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 28 Jan 2009 01:59:53 +0000 Subject: [PATCH] allow either fleshed or unfleshed module objects git-svn-id: svn://svn.open-ils.org/ILS/trunk@12004 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Trigger/ModRunner.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/ModRunner.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/ModRunner.pm index f5a0fe1926..e8d416391f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/ModRunner.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/ModRunner.pm @@ -7,12 +7,11 @@ sub new { 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 @@ sub load { } } 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; -- 2.11.0