Bugzilla – Attachment 192309 Details for
Bug 41402
Do not hide all items if there is a pref OpacMaxItemsToDisplay
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Not tidied patch for QA
not_tidied_patch.txt (text/plain), 4.47 KB, created by
Baptiste Wojtkowski (bwoj)
on 2026-02-02 11:44:06 UTC
(
hide
)
Description:
Not tidied patch for QA
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2026-02-02 11:44:06 UTC
Size:
4.47 KB
patch
obsolete
> >commit 454a6914b1297a2d09e4e3b6bc39f2bb4666285e (HEAD -> BZ41402-reb) >Author: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Mon Dec 8 15:32:35 2025 +0000 > > Bug 41402: Do not hide all items if there is a pref OpacMaxItemsToDisplay > > Test plan: > 1. Set OpacMaxItemsToDisplay to 3. > 2. Add multiple items on a record. > 3. Visit http://koha-ktd:8080/cgi-bin/koha/opac-detail.pl?biblionumber=YOUR_BIBLIONUMBER, notice every items are hidden. > 4. Apply patch > 5. Visit the same page, notice that the 3 first items are displayed > > Signed-off-by: David Nind <david@davidnind.com> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 9d432eaa075..4e69a73fdf8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -595,8 +595,12 @@ > > [% WRAPPER tab_panel tabname="holdings" %] > [% IF too_many_items %] >- <p>This record has many physical items ([% items_count | html %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]&viewallitems=1">View all the physical items.</a></p> >- [% ELSIF ( itemloop.size ) %] >+ <p >+ >This record has many physical items ([% items_count | html %]), some of them are hidden. >+ <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]&viewallitems=1">View all the physical items.</a></p >+ > >+ [% END %] >+ [% IF ( itemloop.size ) %] > [% INCLUDE items_table items=itemloop tab="holdings" table_id="holdingst" %] > [% IF specific_item %] > <p><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Show all items</a></p> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index edf609cb021..3bf5ba344e6 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -698,14 +698,18 @@ my $can_holds_be_placed = $patron ? 0 : $holdable_items; > my ( $itemloop_has_images, $otheritemloop_has_images ); > my $item_level_holds; > my $item_checkouts; >-if ( not $viewallitems and $items->count > $max_items_to_display ) { >+my $library_info; >+my $nb_items_processed = 0; >+while ( my $item = $items->next ) { >+ if ( not $viewallitems and $nb_items_processed >= $max_items_to_display ) { > $template->param( > too_many_items => 1, > items_count => $items->count, > ); >-} else { >- my $library_info; >- while ( my $item = $items->next ) { >+ last; >+ } >+ $nb_items_processed = $nb_items_processed + 1; >+ > my $item_info = $item->unblessed; > $item_info->{holds_count} = $item_reserves{ $item->itemnumber }; > if ( $item_info->{holds_count} && $item_info->{holds_count} > 0 ) { $item_level_holds = 1; } >@@ -723,8 +727,7 @@ if ( not $viewallitems and $items->count > $max_items_to_display ) { > > # We only need to check if we haven't determined holds can be placed > # and if we don't have patron, we have already decided >- $can_holds_be_placed = >- $can_holds_be_placed || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef ); >+ $can_holds_be_placed = $can_holds_be_placed || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef ); > > # get collection code description, too > my $ccode = $item->ccode; >@@ -754,8 +757,8 @@ if ( not $viewallitems and $items->count > $max_items_to_display ) { > $item_info->{checkout} = $item->checkout; > if ( $item_info->{checkout} && $item_info->{checkout} > 0 ) { $item_checkouts = 1; } > >- foreach my $field ( >- qw(ccode materials enumchron copynumber itemnotes location_description uri barcode itemcallnumber)) >+ foreach >+ my $field (qw(ccode materials enumchron copynumber itemnotes location_description uri barcode itemcallnumber)) > { > $itemfields{$field} = 1 if $item_info->{$field}; > } >@@ -796,7 +799,6 @@ if ( not $viewallitems and $items->count > $max_items_to_display ) { > $itemloop_has_images++ if $item->cover_images->count; > } > } >-} > > $template->param( > item_checkouts => $item_checkouts,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 41402
:
190288
|
190314
|
190321
|
192293
|
192307
| 192309