support might_have (search-based, single-valued) in path fleshing
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 1 Mar 2009 18:51:40 +0000 (18:51 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 1 Mar 2009 18:51:40 +0000 (18:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12334 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm

index 0b3a249..e237a3b 100644 (file)
@@ -418,7 +418,7 @@ sub _object_by_path {
     my $meth = 'retrieve_';
     my $multi = 0;
     my $lfield = $step;
-    if ($rtype eq 'has_many') {
+    if ($rtype ne 'has_a') {
         $meth = 'search_';
         $multi = 1;
         $lfield = $context->Identity;
@@ -442,7 +442,7 @@ sub _object_by_path {
 
         $self->_object_by_path( $_, $collector, $label, $path ) for (@$obj_list);
 
-        $obj = $$obj_list[0] if (!$multi);
+        $obj = $$obj_list[0] if (!$multi || $rtype eq 'might_have');
         $context->$step( $obj ) if ($obj && (!$label || !@$label));
 
     } else {