When trying to open the authority editor with authid=<invalid_authid> (e.g. a deleted authid) Koha explodes with a message: << Can't call method "authtypecode" on an undefined value at /kohadevbox/koha/authorities/authorities.pl line 556 >>
Created attachment 166214 [details] [review] Bug 36791: Koha explodes when trying to edit an authority rec. with an invalid authid When trying to open the authority editor with authid=<invalid_authid> (e.g. a deleted authid) Koha explodes with a message: Can't call method "authtypecode" on an undefined value at /kohadevbox/koha/authorities/authorities.pl line 556 This this because authtypecode method is called on the result of ->find without verifying that it was succesful. Test plan: ========== 1. Try to edit an auth rec. giving as a authid (in URL) a non-existing authid, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/authorities/authorities.pl?authid=100000 Koha should explode with the message: Can't call method "authtypecode" on an undefined value at /kohadevbox/koha/authorities/authorities.pl line 556 2. Apply the patch; restart_all. 3. Repeat p. 1. You should get the 404 error page. Sponsored-by: Ignatianum University in Cracow
Created attachment 166234 [details] [review] Bug 36791: Koha explodes when trying to edit an authority rec. with an invalid authid When trying to open the authority editor with authid=<invalid_authid> (e.g. a deleted authid) Koha explodes with a message: Can't call method "authtypecode" on an undefined value at /kohadevbox/koha/authorities/authorities.pl line 556 This this because authtypecode method is called on the result of ->find without verifying that it was succesful. Test plan: ========== 1. Try to edit an auth rec. giving as a authid (in URL) a non-existing authid, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/authorities/authorities.pl?authid=100000 Koha should explode with the message: Can't call method "authtypecode" on an undefined value at /kohadevbox/koha/authorities/authorities.pl line 556 2. Apply the patch; restart_all. 3. Repeat p. 1. You should get the 404 error page. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Created attachment 166465 [details] [review] Bug 36791: Koha explodes when trying to edit an authority rec. with an invalid authid When trying to open the authority editor with authid=<invalid_authid> (e.g. a deleted authid) Koha explodes with a message: Can't call method "authtypecode" on an undefined value at /kohadevbox/koha/authorities/authorities.pl line 556 This this because authtypecode method is called on the result of ->find without verifying that it was succesful. Test plan: ========== 1. Try to edit an auth rec. giving as a authid (in URL) a non-existing authid, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/authorities/authorities.pl?authid=100000 Koha should explode with the message: Can't call method "authtypecode" on an undefined value at /kohadevbox/koha/authorities/authorities.pl line 556 2. Apply the patch; restart_all. 3. Repeat p. 1. You should get the 404 error page. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Created attachment 166466 [details] [review] Bug 36791: (QA follow-up) Simplify conditional Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Nice catch! Passing QA
Pushed for 24.05! Well done everyone, thank you!
Created attachment 166591 [details] [review] Bug 36832: (bug 36791 follow-up) Allow authid=0 To test: 1. Go to the Authorities module and do a Z39.50 search that will return results (e.g. a general subject heading) 2. Import an authority record from the results --> Confirm that the record is imported into the editor
Pushed to 23.11.x for 23.11.06
Backported to 23.05.x for upcoming 23.05.12