From 835bc140529139f7bf9e0db12734bf97b7f21552 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 15 Jan 2020 15:27:56 +0000 Subject: [PATCH] Bug 24423: Add biblionumber to modify items link To test: - Find/create a bib with at least one item - From detail.pl, use the checkboxes in the holdings table to select one or more items - click the "Modify Selected Items" link just above the holdings table to take your item(s) to batch modification - Change something and click save - Observe that the Return to the Record link points to a url without a biblionumber: "/cgi-bin/koha/catalogue/detail.pl?biblionumber=" - Apply patch - Repeat - The link now works! Signed-off-by: Nick Clemens Signed-off-by: David Nind --- Koha/SearchEngine/Elasticsearch/Search.pm | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 1 + tools/batchMod.pl | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm index 635d6b5687..ebf5d242c1 100644 --- a/Koha/SearchEngine/Elasticsearch/Search.pm +++ b/Koha/SearchEngine/Elasticsearch/Search.pm @@ -93,6 +93,7 @@ sub search { $page = (!defined($page) || ($page <= 0)) ? 0 : $page - 1; $query->{from} = $page * $query->{size}; } + warn Data::Dumper::Dumper( $query ); my $elasticsearch = $self->get_elasticsearch(); my $results = eval { $elasticsearch->search( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index a518fb1c4c..2e4f5d9412 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -904,6 +904,7 @@ Note that permanent location is a code, and location may be an authval. if (itemnumbers.length > 0) { var url = '/cgi-bin/koha/tools/batchMod.pl?op=show'; url += '&itemnumber=' + itemnumbers.join('&itemnumber='); + url += '&biblionumber=[% biblionumber | uri %]'; url += '&src=CATALOGUING'; $('a.itemselection_action_modify').attr('href', url); } else { diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 65a25d1c7d..3da1efb80c 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -318,7 +318,7 @@ if ($op eq "show"){ @notfounditemnumbers = grep { !exists $itemdata{$_} } @contentlist; } } else { - if (defined $biblionumber){ + if (defined $biblionumber && !@itemnumbers){ my @all_items = GetItemsInfo( $biblionumber ); foreach my $itm (@all_items) { push @itemnumbers, $itm->{itemnumber}; -- 2.11.0