From 6fa034339865d42a96a9d8463dbbc7a69cbdc58a Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Mon, 9 Sep 2024 12:20:56 +0000 Subject: [PATCH] Bug 37867: (Bug 36794 follow-up) Warning "Use of uninitialized value in substitution..." while creating a new bibliographical record After applying the patch 36794 a warning: Use of uninitialized value in substitution (s///) at kohadevbox/koha/Koha/UI/Form/Builder/Biblio.pm line 53. is being generated when creating a new bibliographical record. Test plan: ========== 1. From the Cataloging module choose "New record". 2. Check the plack-intranet-error.log file--you should see a warning: "Use of uninitialized value in substitution (s///) at /kohadevbox/koha/Koha/UI/Form/Builder/Biblio.pm". 3. Apply the patch; restart_all. 4. Repeat p. 1. There should be no new warning in plack-intranet-error.log. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Owen Leonard --- Koha/UI/Form/Builder/Biblio.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Koha/UI/Form/Builder/Biblio.pm b/Koha/UI/Form/Builder/Biblio.pm index c17d4965e4f..e2ef95439a6 100644 --- a/Koha/UI/Form/Builder/Biblio.pm +++ b/Koha/UI/Form/Builder/Biblio.pm @@ -50,8 +50,10 @@ sub new { my $self = {}; - $self->{biblionumber} = $params->{biblionumber} =~ s/\D//gr; - # just in case biblionumber obtained from CGI and passed directly here contains weird characters like spaces + if ( $params->{biblionumber} ) { + $self->{biblionumber} = $params->{biblionumber} =~ s/\D//gr; + # just in case biblionumber obtained from CGI and passed directly here contains weird characters like spaces + } bless $self, $class; return $self; -- 2.39.2