properly handle errors from multiple process_o2m/m2m actions, #33490
authorMark Wells <mark@freeside.biz>
Thu, 12 Feb 2015 06:59:54 +0000 (22:59 -0800)
committerMark Wells <mark@freeside.biz>
Thu, 12 Feb 2015 06:59:54 +0000 (22:59 -0800)
httemplate/edit/process/elements/process.html

index 698540b..9d8fa79 100644 (file)
@@ -308,7 +308,7 @@ foreach my $value ( @values ) {
       warn "$me processing m2m:\n". Dumper( %$process_m2m )
         if $opt{'debug'};
 
-      $error = $new->process_m2m( %$process_m2m );
+      $error ||= $new->process_m2m( %$process_m2m );
     }
 
   }
@@ -350,7 +350,7 @@ foreach my $value ( @values ) {
                                                );
       }
 
-      $error = $new->process_o2m( %{ $process_o2m },
+      $error ||= $new->process_o2m( %{ $process_o2m },
                                      'params' => scalar($cgi->Vars),
                                    );
     }