[Bug 31873] New: Can't call method "safe_delete" on an undefined value at cataloguing/additem.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Bug ID: 31873 Summary: Can't call method "safe_delete" on an undefined value at cataloguing/additem.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Line 379 in 21.11. Line 415 in master now. my $item = Koha::Items->find($itemnumber); my $error = $item->safe_delete; No check whatsoever. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 142155 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=142155&action=edit 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> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 --- Comment #2 from 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Note that this cannot be backported without change in 21.11 due to Boolean.pm stuff. If needed, I have a patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #142155|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 142206 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=142206&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Depends on| |29746 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29746 [Bug 29746] Add a handy Koha::Result::Boolean class -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #142206|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 143012 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143012&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as described, code is clean. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|22.11.00 |22.11.00, 22.05.09 released in| | --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com Version(s)|22.11.00, 22.05.09 |22.11.00, 22.05.09, released in| |21.11.16 Status|Pushed to stable |Pushed to oldstable --- Comment #9 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- pushed to 21.11.x for 21.11.16 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED Version(s)|22.11.00, 22.05.09, |22.11.00, 22.05.09 released in|21.11.16 | --- Comment #10 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Reverted on 21.11.x branch, missing Koha::Result::Boolean dependency. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31873 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #11 from wainuiwitikapark@catalyst.net.nz --- Not backported to 21.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org