Merge remote-tracking branch 'kc/new/awaiting_qa/bug_6316' into kcmaster
[srvgit] / tools / batchMod.pl
index 921c4d6..4910dbd 100755 (executable)
@@ -429,7 +429,8 @@ sub BuildItemsData{
                        my %this_row;
                        foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) {
                                # loop through each subfield
-                               if (my $itembranchcode=$field->subfield($branchtagsubfield) && C4::Context->preference("IndependantBranches")) {
+                               my $itembranchcode=$field->subfield($branchtagsubfield);
+                               if ($itembranchcode && C4::Context->preference("IndependantBranches")) {
                                                #verifying rights
                                                my $userenv = C4::Context->userenv();
                                                unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $itembranchcode))){
@@ -562,7 +563,7 @@ sub put_in_background {
 
         my $reply = CGI->new("");
         print $reply->header(-type => 'text/html');
-        print "{ jobID: '$jobID' }";
+        print '{"jobID":"' . $jobID . '"}';
         exit 0;
     } elsif (defined $pid) {
         # child