[Koha-bugs] [Bug 27746] Use of uninitialized value $oclc in pattern match (m//) error at C4/Koha.pm
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Apr 2 21:58:58 CEST 2021
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27746
David Nind <david at davidnind.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #117139|0 |1
is obsolete| |
--- Comment #2 from David Nind <david at davidnind.com> ---
Created attachment 119144
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119144&action=edit
Bug 27746: prevent regexp undefined warning when checking subfield contents
($oclc)
Some of the books have subfield "a" of field "035" absent
and it's possible to have such
(it doesn't says "Require" in the interface),
which causes "Use of uninitialized value $oclc in pattern match (m//)"
error.
Solved by screening regex with check for empty variables before the
match.
To reproduce:
1) Edit existing book or create a new one with empty marc
subfield "a" of field "035"
2) Use the search feature that will find it along with some other
books.
3) Check /var/log/koha/kohadev/plack-intranet-error.log to find
"Use of uninitialized value $oclc in pattern match (m//)" error.
4) Apply the patch.
5) Repeat the search and check the logs again to ensure
that error didn't appear again.
Signed-off-by: David Nind <david at davidnind.com>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list