Created attachment 117139 [details] [review] 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.
Created attachment 119144 [details] [review] 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@davidnind.com>
Created attachment 119555 [details] [review] 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@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.05
Pushed to 20.05.x for 20.05.11
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.