Fixed glitch where the first page of bibs in a batch (or the first
page of import batches) was displaying the entire list instead
of the correct number of records per page.

Signed-off-by: Galen Charlton <[email protected]>
---
 C4/ImportBatch.pm |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm
index ede33dd..3fdfb8e 100644
--- a/C4/ImportBatch.pm
+++ b/C4/ImportBatch.pm
@@ -775,11 +775,11 @@ sub GetImportBatchRangeDesc {
                                     WHERE batch_type = 'batch'
                                     ORDER BY import_batch_id DESC";
     my @params;
+    if ($results_per_group){
+        $query .= " LIMIT ?";
+        push(@params, $results_per_group);
+    }
     if ($offset){
-        if ($results_per_group){
-            $query .= " LIMIT ?";
-            push(@params, $results_per_group);
-        }
         $query .= " OFFSET ?";
         push(@params, $offset);
     }
@@ -856,11 +856,11 @@ sub GetImportBibliosRange {
     }
     $query.=" ORDER BY import_record_id";
 
+    if($results_per_group){
+        $query .= " LIMIT ?";
+        push(@params, $results_per_group);
+    }
     if($offset){
-        if($results_per_group){
-            $query .= " LIMIT ?";
-            push(@params, $results_per_group);
-        }
         $query .= " OFFSET ?";
         push(@params, $offset);
     }
-- 
1.7.0

_______________________________________________
Koha-patches mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches

Reply via email to