[Koha-bugs] [Bug 30802] numReturnedItemsToShow doesn't show more than 20 items on the return screen

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 19 07:03:55 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30802

Jonathan Druart <jonathan.druart+koha at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jonathan.druart+koha at gmail.
                   |                            |com

--- Comment #1 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Indeed, there is a 20 hardcoded somewhere else...

A possible fix could be

diff --git a/circ/returns.pl b/circ/returns.pl
index e2d2317a37a..ee874864d05 100755
--- a/circ/returns.pl
+++ b/circ/returns.pl
@@ -94,6 +94,7 @@ my $userenv_branch = $userenv->{'branch'} // '';
 my $forgivemanualholdsexpire = $query->param('forgivemanualholdsexpire');

 my $overduecharges = (C4::Context->preference('finesMode') &&
C4::Context->preference('finesMode') eq 'production');
+my $numReturnedItemsToShow = (
C4::Context->preference('numReturnedItemsToShow') ) ?
C4::Context->preference('numReturnedItemsToShow') : 8;

 # Set up the item stack ....
 my %returneditems;
@@ -104,7 +105,7 @@ foreach ( $query->param ) {
     my $counter;
     if (/ri-(\d*)/) {
         $counter = $1;
-        if ($counter > 20) {
+        if ($counter > $numReturnedItemsToShow) {
             next;
         }
     }
@@ -645,14 +646,13 @@ foreach my $code ( keys %$messages ) {
 $template->param( errmsgloop => \@errmsgloop );

 #set up so only the last 8 returned items display (make for faster loading
pages)
-my $returned_counter = ( C4::Context->preference('numReturnedItemsToShow') ) ?
C4::Context->preference('numReturnedItemsToShow') : 8;
 my $count = 0;
 my @riloop;
 my $shelflocations =
   { map { $_->{authorised_value} => $_->{lib} }
Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '',
kohafield => 'items.location' } ) };
 foreach ( sort { $a <=> $b } keys %returneditems ) {
     my %ri;
-    if ( $count++ < $returned_counter ) {
+    if ( $count++ < $numReturnedItemsToShow ) {
         my $bar_code = $returneditems{$_};
         if ($riduedate{$_}) {
             my $duedate = dt_from_string( $riduedate{$_}, 'sql');

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list