Bug 32583: Restore display of only one item in catalogue/moredetails

Bug 31315 (Remove GetItemsInfo from moredetail) removed the code that limits
the items displayed to only one item if the itemnumber was passed as a
parameter to the page.
This restores that code.

Test plan:

1. find a title with multple items.
2. click on an items barcode in the holdings table on the title details page.
3. observe that all items are shown on the catalogue/moredetails page.
4. apply patch.
5. refresh (catalogue/moredetails) page.
6. observe that only the item for the barcode clicked on is shown.

Signed-off-by: Amaury GAU <amaury.gau@bulac.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Michael Hafen 2023-01-13 10:49:46 -07:00 committed by Tomas Cohen Arazi
parent 0f2cf9f440
commit d88e966ada
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -146,6 +146,9 @@ foreach ( keys %{$data} ) {
$template->param( "$_" => defined $data->{$_} ? $data->{$_} : '' );
}
if ($itemnumber) {
@items = (grep {$_->itemnumber == $itemnumber} @items);
}
my @item_data;
foreach my $item (@items){