Bug 27548: "use of uninitialized value" warning on branchoverdues.pl
On the beginning we have empty "location" parameter for this form,
but that not taken into account in comparison and undef warning emitted:
"Use of uninitialized value $location in string eq at
/usr/share/koha/intranet/cgi-bin/circ/branchoverdues.pl line 72" in branchoverdues.pl
Fixed by adding pre-check for $location.
To reproduce:
1) Head over to "Circulation ->Overdues with fines" page. Check
intranet-error.log where there will be many warnings
"Use of uninitialized value $location in string eq at /usr/share/koha/intranet/cgi-bin/circ/branchoverdues.pl line 72".
2) Apply the patch, refresh the "Overdues with fines" page.
3) Ensure that the new "use of uninitialized value" warnings didn't appear in the console.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c3d2268756)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
bc86c63c6b
commit
44d1675aaf
|
|
@ -69,7 +69,7 @@ my ($tag,$subfield) = GetMarcFromKohaField( 'items.location' );
|
|||
my $tagslib = &GetMarcStructure(1,'');
|
||||
if ($tagslib->{$tag}->{$subfield}->{authorised_value}) {
|
||||
my $values= GetAuthorisedValues($tagslib->{$tag}->{$subfield}->{authorised_value});
|
||||
for (@$values) { $_->{selected} = 1 if $location eq $_->{authorised_value} }
|
||||
for (@$values) { $_->{selected} = 1 if defined $location && $location eq $_->{authorised_value} }
|
||||
$template->param(locationsloop => $values);
|
||||
}
|
||||
# now display infos
|
||||
|
|
|
|||
Loading…
Reference in New Issue