leave existing intermediate objects alone in the path if they are already fleshed
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Mar 2009 20:27:55 +0000 (20:27 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Mar 2009 20:27:55 +0000 (20:27 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12356 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index d3dc043..d6781cf 100644 (file)
@@ -432,13 +432,20 @@ sub _object_by_path {
             $self->editor :
             new_rstore_editor();
 
-    my $obj = $ed->$meth( 
-        ($multi) ? { $ffield => $context->$lfield() } : $context->$lfield() );
+    my $obj = $context->$step(); 
+
+    if (!ref $obj) {
+        $obj = $ed->$meth( 
+            ($multi) ?
+                { $ffield => $context->$lfield() } :
+                $context->$lfield()
+        );
+    }
 
     if (@$path) {
 
         my $obj_list = [];
-        if (!$multi) {
+        if (!$multi || $rtype eq 'might_have') {
             $obj_list = [$obj] if ($obj);
         } else {
             $obj_list = $obj;