From bb47a5ffe623cdf17b0277433c6ccf53b5c4d141 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 14 May 2026 14:25:38 +0000 Subject: [PATCH] Bug 42606: Check for default framework earlier The code switches 'Default' to '' - we should just do it immediately after fetching from the template 1 - From the cataloging home page, click "New from Z39.50" without choosing a framework in the dropdown menu. 2 - Perform a Z39.50 search in the popup window, then click "Import" for one of the results. This triggers an error in the parent window: 3 - Error:Can't call method "is_fast_add" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 518 4 - Apply patch 5 - Reload and repeat 6 - Success! Signed-off-by: Brendan Lawlor Signed-off-by: Jan Kissig Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass --- cataloguing/addbiblio.pl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index f91b3060fe..1db6677fec 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -489,14 +489,15 @@ sub build_tabs { # ======================== # MAIN #========================= -my $input = CGI->new; -my $error = $input->param('error'); -my $biblionumber = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio. -my $parentbiblio = $input->param('parentbiblionumber'); -my $breedingid = $input->param('breedingid'); -my $z3950 = $input->param('z3950'); -my $mode = $input->param('mode') // q{}; -my $frameworkcode = $input->param('frameworkcode'); +my $input = CGI->new; +my $error = $input->param('error'); +my $biblionumber = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio. +my $parentbiblio = $input->param('parentbiblionumber'); +my $breedingid = $input->param('breedingid'); +my $z3950 = $input->param('z3950'); +my $mode = $input->param('mode') // q{}; +my $frameworkcode = $input->param('frameworkcode'); +$frameworkcode = '' if ( $frameworkcode eq 'Default' ); my $redirect = $input->param('redirect'); my $searchid = $input->param('searchid') // ""; my $dbh = C4::Context->dbh; @@ -534,8 +535,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -$frameworkcode = '' if ( $frameworkcode eq 'Default' ); - # Set default values for global variable $tagslib = &GetMarcStructure( 1, $frameworkcode ); $usedTagsLib = &GetUsedMarcStructure($frameworkcode);