[open-ils-commits] r12541 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Mar 16 12:45:00 EDT 2009


Author: erickson
Date: 2009-03-16 12:44:58 -0400 (Mon, 16 Mar 2009)
New Revision: 12541

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
Log:
pass hint instead of class as core_type

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm	2009-03-16 16:39:29 UTC (rev 12540)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm	2009-03-16 16:44:58 UTC (rev 12541)
@@ -139,6 +139,7 @@
     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 @@
             }
         },
         where  => {
-            "+ath"  => { core_type=> $object_ident_field },
+            "+ath"  => { core_type => $obj_hint },
             "+atevdef" => { active => 't' },
             "+atev" => { state => 'pending' }
         },
@@ -232,6 +233,10 @@
     argc     => 2
 );
  
+sub _fm_hint_by_class {
+    my $class = shift;
+    return Fieldmapper->publish_fieldmapper->{$class}->{hint};
+}
 
 sub _fm_class_by_hint {
     my $hint = shift;



More information about the open-ils-commits mailing list