Bug 9924: (follow-up) ensure that correct error message is displayed
[koha.git] / patroncards / image-manage.pl
index f9f7eac..cf5257a 100755 (executable)
@@ -54,8 +54,7 @@ if ($op eq 'upload') {
             SOURCE_FILE => $source_file,
             IMAGE_NAME => $image_name,
             TABLE => $table,
-            error => 1,
-            $errstr => 1,
+            error => $errstr,
         );
     }
     else {
@@ -69,8 +68,7 @@ if ($op eq 'upload') {
                 SOURCE_FILE => $source_file,
                 IMAGE_NAME => $image_name,
                 TABLE => $table,
-                error => 1,
-                $errstr => 1,
+                error => $errstr,
             );
         }
         else {
@@ -87,8 +85,7 @@ if ($op eq 'upload') {
                     SOURCE_FILE => $source_file,
                     IMAGE_NAME => $image_name,
                     TABLE => $table,
-                    error => 1,
-                    $errstr => 1,
+                    error => $errstr,
                     image_limit => $image_limit,
                 );
             }
@@ -120,8 +117,7 @@ elsif ($op eq 'delete') {
             DELETE_SUCCESSFULL => 0,
             IMAGE_IDS => join(', ', @image_ids),
             TABLE => $table,
-            error => 1,
-            $errstr => 1,
+            error => $errstr,
             image_ids => join(',',@image_ids),
         );
     }
@@ -149,8 +145,7 @@ else { # to trap unsupported operations
         SOURCE_FILE => $source_file,
         IMAGE_NAME => $image_name,
         TABLE => $table,
-        error => 1,
-        $errstr => 1,
+        error => $errstr,
     );
 }