From 49293419409931a1b11d12b60cbed7fcbb16a0f7 Mon Sep 17 00:00:00 2001 From: Andrew Nugged Date: Mon, 3 Jan 2022 12:44:07 +0200 Subject: [PATCH] Bug 20447: (QA follow-up) bugfix: undefined holding_id in code on store After saving to DB code didn't get back "last inserted ID" so wasn't able to allow for interface to go back to newly created holding ID Signed-off-by: Nick Clemens --- cataloguing/addholding.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cataloguing/addholding.pl b/cataloguing/addholding.pl index c78c11a4a4..55e8fad6ff 100755 --- a/cataloguing/addholding.pl +++ b/cataloguing/addholding.pl @@ -618,7 +618,9 @@ if ($op eq 'add') { $record->set_marc({ record => $marc }); $record->store(); - if ($redirect eq 'items' || ($mode ne 'popup' && !$holding_id && $redirect ne 'view' && $redirect ne 'just_save')) { + $holding_id = $record->holding_id; + + if ($redirect eq 'items' || ($mode ne 'popup' && $redirect ne 'view' && $redirect ne 'just_save')) { print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid"); exit; } elsif ($holding_id && $redirect eq 'view') { -- 2.37.2