Summary: | Can't call method "safe_delete" on an undefined value at cataloguing/additem.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Architecture, internals, and plumbing | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | CLOSED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | normal | ||
Priority: | P5 - low | CC: | arthur.suzuki, lucas, martin.renvoize, wainuiwitikapark |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00, 22.05.09
|
|
Circulation function: | |||
Bug Depends on: | 29746 | ||
Bug Blocks: | |||
Attachments: |
Bug 31873: Check ->find before calling ->safe_delete
Bug 31873: Check ->find before calling ->safe_delete Bug 31873: Check ->find before calling ->safe_delete |
Description
Marcel de Rooy
2022-10-19 13:37:07 UTC
Created attachment 142155 [details] [review] Bug 31873: Check ->find before calling ->safe_delete When there is no item, you cannot safely delete it :) Resolve this warning: Can't call method "safe_delete" on an undefined value at /usr/share/koha/cataloguing/additem.pl line 379 (Line numbers may vary across versions.) Test plan: Open item editor. Add a new item. Add another tab with same form. Delete new item. Go back to former tab. Try to delete again. You should see an alert now on top of the form. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> NOTE: The log file did not tell me the real reproduction scenario but the test plan should be enough to catch the point. Note that this cannot be backported without change in 21.11 due to Boolean.pm stuff. If needed, I have a patch. Created attachment 142206 [details] [review] Bug 31873: Check ->find before calling ->safe_delete When there is no item, you cannot safely delete it :) Resolve this warning: Can't call method "safe_delete" on an undefined value at /usr/share/koha/cataloguing/additem.pl line 379 (Line numbers may vary across versions.) Test plan: Open item editor. Add a new item. Add another tab with same form. Delete new item. Go back to former tab. Try to delete again. You should see an alert now on top of the form. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> https://bugs.koha-community.org/show_bug.cgi?id=31783 Created attachment 143012 [details] [review] Bug 31873: Check ->find before calling ->safe_delete When there is no item, you cannot safely delete it :) Resolve this warning: Can't call method "safe_delete" on an undefined value at /usr/share/koha/cataloguing/additem.pl line 379 (Line numbers may vary across versions.) Test plan: Open item editor. Add a new item. Add another tab with same form. Delete new item. Go back to former tab. Try to delete again. You should see an alert now on top of the form. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Works as described, code is clean. Passing QA Pushed to master for 22.11. Nice work everyone, thanks! Backported to 22.05.x for upcoming 22.05.09 pushed to 21.11.x for 21.11.16 Reverted on 21.11.x branch, missing Koha::Result::Boolean dependency. Not backported to 21.05.x |