[Bug 36786] New: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Bug ID: 36786 Summary: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: januszop@gmail.com Reporter: januszop@gmail.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl After changes made to addbiblio with the bug 31791, when trying to open the editor with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 --- Comment #1 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 166190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166190&action=edit Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber After changes made to addbiblio with the bug 31791, when trying to open the editor with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >> Test plan: ========== 1. Try to edit a biblio giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=1234... Koha should explode with the message: Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 2. Apply the patch; restart_all. 3. Repeat p.1. You should get the 403 error page. Sponsored-by: Ignatianum University in Cracow -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Roman Dolny <roman.dolny@jezuici.pl> 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=36786 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166190|0 |1 is obsolete| | --- Comment #2 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 166233 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166233&action=edit Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber After changes made to addbiblio with the bug 31791, when trying to open the editor with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >> Test plan: ========== 1. Try to edit a biblio giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=1234... Koha should explode with the message: Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 2. Apply the patch; restart_all. 3. Repeat p.1. You should get the 403 error page. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31791 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31791 [Bug 31791] Add the ability to lock records to prevent modification through the Koha staff interface -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Hi, I felt tempted to rewrite all those conditionals on adding this feature. I didn't do it because I didn't intend to change other behaviors. One of those is the fact this page has some custom handling of the record not found use case. I don't think it is THAT important, but with your patch, that part of the template becomes unreachable, and thus requires a cleanup. That said, I'd suggest you make the condition be checked as an else of the previous one: ```perl if ($biblio) { if ( !$biblio->can_be_edited($logged_in_patron) ) { print $input->redirect("/cgi-bin/koha/errors/403.pl"); # escape early exit; } else { $biblionumber = undef; $template->param( bib_doesnt_exist => 1 ); } ``` Otherwise you will be returning 403 when the record doesn't exist, which should be a 404 and has specific code for handling it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 --- Comment #4 from Janusz Kaczmarek <januszop@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #3)
That said, I'd suggest you make the condition be checked as an else of the previous one:
Thank you, Tomás, you are right--that would be much better! A new version follows. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166233|0 |1 is obsolete| | --- Comment #5 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 166260 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166260&action=edit Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber After changes made to addbiblio with the bug 31791, when trying to open the editor with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >> Test plan: ========== 1. Try to edit a biblio giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=1234... Koha should explode with the message: Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 2. Apply the patch; restart_all. 3. Repeat p.1. You should get the 403 error page. Sponsored-by: Ignatianum University in Cracow -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166260|0 |1 is obsolete| | --- Comment #6 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 166262 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166262&action=edit Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber After changes made to addbiblio with the bug 31791, when trying to open the editor with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >> Test plan: ========== 1. Try to edit a biblio giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=1234... Koha should explode with the message: Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 2. Apply the patch; restart_all. 3. Repeat p.1. You should get a page with the info: "The record you are trying to edit doesn't exist...". Sponsored-by: Ignatianum University in Cracow -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.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=36786 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166262|0 |1 is obsolete| | --- Comment #7 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 166285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166285&action=edit Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber After changes made to addbiblio with the bug 31791, when trying to open the editor with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >> Test plan: ========== 1. Try to edit a biblio giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=1234... Koha should explode with the message: Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 2. Apply the patch; restart_all. 3. Repeat p.1. You should get a page with the info: "The record you are trying to edit doesn't exist...". Sponsored-by: Ignatianum University in Cracow Signed-off-by: Matt Blenkinsop <matt.blenkinsop@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=36786 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch 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=36786 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #166285|0 |1 is obsolete| | --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 166328 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=166328&action=edit Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber After changes made to addbiblio with the bug 31791, when trying to open the editor with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >> Test plan: ========== 1. Try to edit a biblio giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=1234... Koha should explode with the message: Can't call method "can_be_edited" on an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 2. Apply the patch; restart_all. 3. Repeat p.1. You should get a page with the info: "The record you are trying to edit doesn't exist...". Sponsored-by: Ignatianum University in Cracow Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|(Bug 31791 follow-up) Koha |(Bug 31791 follow-up) Koha |explodes when trying to |explodes when trying to |edit a biblio with invalid |edit a bibliographic record |biblionumber |with an invalid | |biblionumber -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |fridolin.somers@biblibre.co | |m --- Comment #10 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 31791 not in 23.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 Bug 36786 depends on bug 31791, which changed state. Bug 31791 Summary: Add the ability to lock records to prevent modification through the Koha staff interface https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31791 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36786 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #11 from David Nind <david@davidnind.com> --- No changes required to the manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org