Bug 35989: Stop geographic authority searches crashing
authorMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Thu, 16 May 2024 09:33:34 +0000 (09:33 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 27 Jun 2024 13:35:23 +0000 (13:35 +0000)
commit6dfb1dd9317ff916b8e7aa13aeb1601252118dea
tree4cfa654c4e37c2be29a6c25218a40874eb55a4ee
parent31dd31d324e9bfdcc8673165d27d332aa8b64e13
Bug 35989: Stop geographic authority searches crashing

Currently when searching for a geographic authority record the search will fail if the record has a heading in a 78X field. The system tries to do a regex match against an undefined variable causing an error. This patch makes that regex match conditional on the variable being defined to allow the search to succeed.

Test plan:
1) Navigate to Authorities
2) In the search bar at the top of the page, click on the dropdown options and in the 'Authority type' field, select 'Geographic Name'
3) Click search
4) You should have a list of authorities
5) Click on any authority record and then click edit and select to edit the record
6) Click on the "7" button
7) Click on the green text next to the '781' field to get the list of fields
8) In field 'v' enter any string you like
9) Click save
10) Repeat steps 1-3, this time it should display an error message for an Unmatched [ in regex
11) Apply patch
12) restart_all
13) Refresh the page, the results should show and the string you entered in the 'v' field should display on the record you edited

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6c9482f213ba7f65de490f49b1ddf3425a4ab478)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/AuthoritiesMarc.pm