Summary: | Koha explodes when trying to edit an authority record with an invalid authid | ||
---|---|---|---|
Product: | Koha | Reporter: | Janusz Kaczmarek <januszop> |
Component: | MARC Authority data support | Assignee: | Janusz Kaczmarek <januszop> |
Status: | Pushed to oldstable --- | QA Contact: | Emily Lamancusa (emlam) <emily.lamancusa> |
Severity: | normal | ||
Priority: | P5 - low | CC: | emily.lamancusa, fridolin.somers, lucas |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | Sponsored | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
24.05.00,23.11.06,23.05.12
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 36832 | ||
Attachments: |
Bug 36791: Koha explodes when trying to edit an authority rec. with an invalid authid
Bug 36791: Koha explodes when trying to edit an authority rec. with an invalid authid Bug 36791: Koha explodes when trying to edit an authority rec. with an invalid authid Bug 36791: (QA follow-up) Simplify conditional Bug 36832: (bug 36791 follow-up) Allow authid=0 |
Description
Janusz Kaczmarek
2024-05-06 11:19:04 UTC
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 |