From: erickson Date: Mon, 16 Mar 2009 16:44:58 +0000 (+0000) Subject: pass hint instead of class as core_type X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d00478cccbec88d594f57ae65a62d966429bac4d;p=Evergreen.git pass hint instead of class as core_type git-svn-id: svn://svn.open-ils.org/ILS/trunk@12541 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm index 71b8c86270..34ecff5771 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm @@ -139,6 +139,7 @@ sub events_by_target { my $filter = shift || {}; my $obj_class = ref($object) || _fm_class_by_hint($object); + my $obj_hint = ref($object) ? _fm_hint_by_class(ref($object)) : $object; my $object_ident_field = $obj_class->Identity; @@ -156,7 +157,7 @@ sub events_by_target { } }, where => { - "+ath" => { core_type=> $object_ident_field }, + "+ath" => { core_type => $obj_hint }, "+atevdef" => { active => 't' }, "+atev" => { state => 'pending' } }, @@ -232,6 +233,10 @@ __PACKAGE__->register_method( argc => 2 ); +sub _fm_hint_by_class { + my $class = shift; + return Fieldmapper->publish_fieldmapper->{$class}->{hint}; +} sub _fm_class_by_hint { my $hint = shift;