From 676fc65d80c842c91284150bf9f508fb40f2bd10 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 27 Jun 2023 09:54:22 +0000 Subject: [PATCH] Bug 34128: Prevent holdings table from incorrectly ordering items This patch stops the hildings table from incorrectly ordering books as serials Test plan: 1) In cataloging, click on New record 2) Fill in all the required fields with generic data, ensuring that the 942c field (Koha item type) is "Books" 3) In the 490a field - fill in any string as the Series statement 4) Click save 5) You should now be on the Add item page. We need to add 3+ items, making sure that the Home and Current libraries for each item are in reverse alphabetical order. e.g. Item 1: - Home library: Midway - Current library: Midway Item 2: - Home library: Fairview - Current library: Fairview Item 1: - Home library: Centerville - Current library: Centerville 6) In the top searchbar, find your new item that you have just added 7) On the item detail page, the holdings table will be displaying the items in reverse alphabetical order by library rather than in alphabetical order as it should be by default. 8) Apply patch 9) Refresh the item detail page - the items should now be correctly ordered. --- Koha/Items.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Items.pm b/Koha/Items.pm index 3f3ba3fb4f..5d47a20b78 100644 --- a/Koha/Items.pm +++ b/Koha/Items.pm @@ -438,7 +438,8 @@ sub search_ordered { my @biblionumbers = uniq $self->get_column('biblionumber'); if ( scalar ( @biblionumbers ) == 1 - && Koha::Biblios->find( $biblionumbers[0] )->serial ) + && Koha::Biblios->find( $biblionumbers[0] )->serial + && Koha::Biblios->find( $biblionumbers[0] )->{frameworkcode} eq 'SER' ) { return $self->search( {}, -- 2.37.1 (Apple Git-137.1)