[Bug 21556] New: Deleting same record twice leads to fatal software error
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Bug ID: 21556 Summary: Deleting same record twice leads to fatal software error Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl If you click "Edit" then "Delete record" then "OK" when it prompts "Are you sure you want to delete this record?" then repeat the process again while the page is loading, you'll generate a fatal error. On a Plack-enabled kohadevbox, you'll see: Internal Server Error If you look at /var/log/koha/kohadev/plack-error.log, you'll see: Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 406. On a regular dev instance, you might see in the browser window: Can't call method "holds" on an undefined value at /path/to/git/C4/Biblio.pm line 406. -- 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=21556 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=21556 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 80442 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80442&action=edit Bug 21556: Deleting same record twice leads to fatal software error If you delete a record, confirm the deletion, and try to delete the record and confirm it again befoe the first deletion completes, you'll generate a fatal software error. This patch unbinds the click handlers for the "Delete record" button after the deletion is confirmed and just before the Javascript processes the redirect to the next page in the process. To test: 1) You will need a bibliographic record that is able to be deleted 2) Click "Edit", then "Delete record", then "OK" 3) While the browser is reloading, click "Edit", then "Delete record", then "OK 4) Observe a fatal error such as "Internal server error" or 'Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 406.' 5) Apply the patch 6) Run "restart_all" on kohadevbox (or otherwise restart Plack if running Plack) 7) Navigate to another bibliographic record that is able to be deleted 8) Click "Edit", then "Delete record", then "OK" 9) While the browser is reloading, click "Edit", then "Delete record" 10) Observe that no fatal software error is generated 11) You are redirected to http://localhost:8081/cgi-bin/koha/catalogue/search.pl (on kohadevbox) -- 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=21556 Pierre-Marc Thibault <pierre-marc.thibault@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80442|0 |1 is obsolete| | --- Comment #2 from Pierre-Marc Thibault <pierre-marc.thibault@inlibro.com> --- Created attachment 80559 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80559&action=edit Bug 21556: Deleting same record twice leads to fatal software error If you delete a record, confirm the deletion, and try to delete the record and confirm it again befoe the first deletion completes, you'll generate a fatal software error. This patch unbinds the click handlers for the "Delete record" button after the deletion is confirmed and just before the Javascript processes the redirect to the next page in the process. To test: 1) You will need a bibliographic record that is able to be deleted 2) Click "Edit", then "Delete record", then "OK" 3) While the browser is reloading, click "Edit", then "Delete record", then "OK 4) Observe a fatal error such as "Internal server error" or 'Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 406.' 5) Apply the patch 6) Run "restart_all" on kohadevbox (or otherwise restart Plack if running Plack) 7) Navigate to another bibliographic record that is able to be deleted 8) Click "Edit", then "Delete record", then "OK" 9) While the browser is reloading, click "Edit", then "Delete record" 10) Observe that no fatal software error is generated 11) You are redirected to http://localhost:8081/cgi-bin/koha/catalogue/search.pl (on kohadevbox) -- 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=21556 Pierre-Marc Thibault <pierre-marc.thibault@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80559|0 |1 is obsolete| | --- Comment #3 from Pierre-Marc Thibault <pierre-marc.thibault@inlibro.com> --- Created attachment 80560 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80560&action=edit Bug 21556: Deleting same record twice leads to fatal software error If you delete a record, confirm the deletion, and try to delete the record and confirm it again befoe the first deletion completes, you'll generate a fatal software error. This patch unbinds the click handlers for the "Delete record" button after the deletion is confirmed and just before the Javascript processes the redirect to the next page in the process. To test: 1) You will need a bibliographic record that is able to be deleted 2) Click "Edit", then "Delete record", then "OK" 3) While the browser is reloading, click "Edit", then "Delete record", then "OK 4) Observe a fatal error such as "Internal server error" or 'Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 406.' 5) Apply the patch 6) Run "restart_all" on kohadevbox (or otherwise restart Plack if running Plack) 7) Navigate to another bibliographic record that is able to be deleted 8) Click "Edit", then "Delete record", then "OK" 9) While the browser is reloading, click "Edit", then "Delete record" 10) Observe that no fatal software error is generated 11) You are redirected to http://localhost:8081/cgi-bin/koha/catalogue/search.pl (on kohadevbox) Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> -- 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=21556 Pierre-Marc Thibault <pierre-marc.thibault@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |pierre-marc.thibault@inlibr | |o.com -- 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=21556 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | CC| |katrin.fischer@bsz-bw.de --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi David, please don't forget to assign the bug to yourself! -- 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=21556 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #4)
Hi David, please don't forget to assign the bug to yourself!
Oops! Thanks for the reminder! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Pierre-Marc Thibault from comment #3)
2) Click "Edit", then "Delete record", then "OK" 3) While the browser is reloading, click "Edit", then "Delete record", then "OK
Under plack it's impossible for my (local install) to recreate that, I am not that fast! However I do recreate that: - Click "Edit", then "Delete record", then "OK" - You are redirected to the search form - Click back - Click "Edit", then "Delete record", then "OK" => Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 387 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80670 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80670&action=edit Bug 21556: Do not crash if a biblio is deleted twice To recreate: - Go to a bibliographic detail page - Delete it - Go back - Delete it again => Without this patch you will get a 500 Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 406. => With this patch applied it will silently redirect you to the search form. Note: We could/should improve the behavior and display a message, but DelBiblio will need to be moved to Koha::Biblio->delete and other callers adjusted -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Second patch needs a signoff, maybe first patch is not necessary now (?) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 --- Comment #9 from Pierre-Marc Thibault <pierre-marc.thibault@inlibro.com> --- I had the same issue for the second test, though I cannot tell if plack was on. I noticed that, when you click on "OK", the option to delete was still open afterwards. So, what I did is that, when "OK" appeared, instead of clicking "OK", I pressed "Enter" which does the same thing. Since you don't have to move the mouse, you can do Enter, click and Enter quickly enough to do the test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- Good points, Jonathan. It would be good to have a more graceful handling of this scenario. I think disabling the "Delete Record" in the frontend UI after clicking it still makes sense, but I'm on board for fixing the backend too. Will look at testing/signing off later today... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 M. Tompsett <mtompset@hotmail.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=21556 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80670|0 |1 is obsolete| | --- Comment #11 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 80685 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80685&action=edit Bug 21556: Do not crash if a biblio is deleted twice To recreate: - Go to a bibliographic detail page - Delete it - Go back - Delete it again => Without this patch you will get a 500 Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 406. => With this patch applied it will silently redirect you to the search form. Note: We could/should improve the behavior and display a message, but DelBiblio will need to be moved to Koha::Biblio->delete and other callers adjusted Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #12 from M. Tompsett <mtompset@hotmail.com> --- I think both patches should be used, because the javascript catches the client-side stuff and thus speed up ignoring things. However, if someone intentionally attempts to hack requests to the backend, the perl patch is necessary. This gives speed to the average user, and security from those trying to break Koha. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80560|0 |1 is obsolete| | Attachment #80685|0 |1 is obsolete| | --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 81813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81813&action=edit Bug 21556: Deleting same record twice leads to fatal software error If you delete a record, confirm the deletion, and try to delete the record and confirm it again befoe the first deletion completes, you'll generate a fatal software error. This patch unbinds the click handlers for the "Delete record" button after the deletion is confirmed and just before the Javascript processes the redirect to the next page in the process. To test: 1) You will need a bibliographic record that is able to be deleted 2) Click "Edit", then "Delete record", then "OK" 3) While the browser is reloading, click "Edit", then "Delete record", then "OK 4) Observe a fatal error such as "Internal server error" or 'Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 406.' 5) Apply the patch 6) Run "restart_all" on kohadevbox (or otherwise restart Plack if running Plack) 7) Navigate to another bibliographic record that is able to be deleted 8) Click "Edit", then "Delete record", then "OK" 9) While the browser is reloading, click "Edit", then "Delete record" 10) Observe that no fatal software error is generated 11) You are redirected to http://localhost:8081/cgi-bin/koha/catalogue/search.pl (on kohadevbox) Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 81814 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81814&action=edit Bug 21556: Do not crash if a biblio is deleted twice To recreate: - Go to a bibliographic detail page - Delete it - Go back - Delete it again => Without this patch you will get a 500 Can't call method "holds" on an undefined value at /home/vagrant/kohaclone/C4/Biblio.pm line 406. => With this patch applied it will silently redirect you to the search form. Note: We could/should improve the behavior and display a message, but DelBiblio will need to be moved to Koha::Biblio->delete and other callers adjusted Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #15 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |martin.renvoize@ptfs-europe | |.com --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.05.x for 18.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@bugs.koha-c |y.org |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED --- Comment #17 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.11.x for 17.11.13 "You Only Live Twice"... so you may be deleted twice ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21556 --- Comment #18 from David Cook <dcook@prosentient.com.au> --- (In reply to Fridolin SOMERS from comment #17)
Pushed to 17.11.x for 17.11.13
"You Only Live Twice"... so you may be deleted twice ;)
hehehe -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org