Bug 5449: JSON malformed in Koha - Blocker with jQuery 1.4.x
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 11 Mar 2011 13:36:53 +0000 (14:36 +0100)
committerChris Cormack <chrisc@catalyst.net.nz>
Fri, 11 Mar 2011 19:53:41 +0000 (08:53 +1300)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

offline_circ/process_koc.pl
test/progressbarsubmit.pl
tools/background-job-progress.pl
tools/batchMod.pl
tools/manage-marc-import.pl
tools/stage-marc-import.pl
tools/upload-file-progress.pl
tools/upload-file.pl

index b22ae24..6c48ffb 100755 (executable)
@@ -92,7 +92,7 @@ if ($completedJobID) {
 
             my $reply = CGI->new("");
             print $reply->header(-type => 'text/html');
-            print "{ jobID: '$jobID' }";
+            print '{"jobID":"' . $jobID . '"}';
             exit 0;
         } elsif (defined $pid) {
             # child
index 22b0a41..0982f58 100755 (executable)
@@ -72,7 +72,7 @@ if ($completedJobID) {
 
             my $reply = CGI->new("");
             print $reply->header(-type => 'text/html');
-            print "{ jobID: '$jobID' }";
+            print '{"jobID":"' . $jobID . '"}';
             exit 0;
         } elsif (defined $pid) {
         # if we get here, we're a child that has detached
index db4d890..380ad15 100755 (executable)
@@ -36,7 +36,7 @@ my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value,
 if ($auth_status ne "ok") {
     my $reply = CGI->new("");
     print $reply->header(-type => 'text/html');
-    print "{ progress: 0 }";
+    print '{"progress":"0"}';
     exit 0;
 }
 
@@ -54,4 +54,4 @@ if (defined $job) {
 my $reply = CGI->new("");
 print $reply->header(-type => 'text/html');
 # response will be sent back as JSON
-print "{ progress: $reported_progress, job_size: $job_size, job_status: '$job_status' }";
+print '{"progress":"' . $reported_progress . '","job_size":"' . $job_size . '","job_status":"' . $job_status . '"}';
index d9a0b76..4910dbd 100755 (executable)
@@ -563,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
index e7ff78e..f40596e 100755 (executable)
@@ -298,7 +298,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
index b113332..54ebfb9 100755 (executable)
@@ -108,7 +108,7 @@ if ($completedJobID) {
 
             my $reply = CGI->new("");
             print $reply->header(-type => 'text/html');
-            print "{ jobID: '$jobID' }";
+            print '{"jobID":"' . $jobID . '"}';
             exit 0;
         } elsif (defined $pid) {
             # child
index e3a643b..c457dbb 100755 (executable)
@@ -35,7 +35,7 @@ my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value,
 if ($auth_status ne "ok") {
     my $reply = CGI->new("");
     print $reply->header(-type => 'text/html');
-    print "{ progress: 0 }";
+    print '{"progress":"0"}';
     exit 0;
 }
 
@@ -44,4 +44,4 @@ my $reported_progress = C4::UploadedFile->upload_progress($sessionID);
 my $reply = CGI->new("");
 print $reply->header(-type => 'text/html');
 # response will be sent back as JSON
-print "{ progress: $reported_progress }";
+print '{"progress":"' . $reported_progress . '"}';
index 1f38d07..d520b4d 100755 (executable)
@@ -80,5 +80,5 @@ sub send_reply {
     my $reply = CGI->new("");
     print $reply->header(-type => 'text/html');
     # response will be sent back as JSON
-    print "{ status: '$upload_status', fileid: '$fileid' }";
+    print '{"status":"' . $upload_status . '","fileid":"' . $fileid . '"}';
 }