[Bug 34609] New: Holds history errors 500 if old_reserves.biblionumber is NULL
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Bug ID: 34609 Summary: Holds history errors 500 if old_reserves.biblionumber is NULL Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Hold requests Assignee: koha-bugs@lists.koha-community.org Reporter: pedro.amorim@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, jonathan.druart+koha@gmail.com, katrin.fischer@bsz-bw.de, martin.renvoize@ptfs-europe.com, nick@bywatersolutions.com, tomascohen@gmail.com Depends on: 32894 To reproduce, clean k-t-d: 1) Add a reserve to koha/koha user, mysql run: insert into reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, biblionumber) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 76); 2) Add an old_reserve to koha/koha user, mysql run: insert into old_reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, reserve_id) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 1); 3) Visit holdshistory on either OPAC (requires OPACHoldsHistory sys pref) or STAFF STAFF/cgi-bin/koha/members/holdshistory.pl?borrowernumber=1 OPAC//cgi-bin/koha/opac-holdshistory.pl 4) Notice it blows up with a 500 error Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32894 [Bug 32894] Objects cache methods' result without invalidation -- 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=34609 Pedro Amorim <pedro.amorim@ptfs-europe.com> 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=34609 --- Comment #1 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154738 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154738&action=edit Bug 34609: Return empty if no biblionumber Test plan, clean k-t-d: 1) Add a reserve to koha/koha user, mysql run: insert into reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, biblionumber) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 76); 2) Add an old_reserve to koha/koha user, mysql run: insert into old_reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, reserve_id) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 1); 3) Visit holdshistory on either OPAC (requires OPACHoldsHistory sys pref) or STAFF STAFF/cgi-bin/koha/members/holdshistory.pl?borrowernumber=1 OPAC//cgi-bin/koha/opac-holdshistory.pl 4) Notice it blows up with a 500 error 5) Repeat step 3 -- 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=34609 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Assignee|koha-bugs@lists.koha-commun |pedro.amorim@ptfs-europe.co |ity.org |m -- 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=34609 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- *** Bug 34603 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Thanks Pedro, this works! Do you think we need unit tests for this change? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- There's some prior art for tests for this 🙂. I hate writing them as they feel like over repetition... but they would have caught this regression.. so... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 --- Comment #5 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Lucas Gass from comment #3)
Thanks Pedro, this works! Do you think we need unit tests for this change?
Thanks Lucas, I had not realized there was already a bug filed for this. What I think happened is, the biblio method in Hold.pm returned undef if it did not have a biblionumber, but after this patch: https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=32894&attachment=152086 It started returning an empty DBix::ResultSource(?) instead of undef leading to holdhistory.tt to explode. A test making sure biblio in Hold.pm returns either a biblio object or undef would certainly been helpful before bug 32894, and certainly does not hurt now either! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Ray Delahunty <r.delahunty@arts.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |r.delahunty@arts.ac.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Pedro Amorim <pedro.amorim@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=34609 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154738|0 |1 is obsolete| | --- Comment #6 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154901 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154901&action=edit Bug 34609: Return empty if no biblionumber Test plan, clean k-t-d: 1) Add a reserve to koha/koha user, mysql run: insert into reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, biblionumber) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 76); 2) Add an old_reserve to koha/koha user, mysql run: insert into old_reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, reserve_id) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 1); 3) Visit holdshistory on either OPAC (requires OPACHoldsHistory sys pref) or STAFF STAFF/cgi-bin/koha/members/holdshistory.pl?borrowernumber=1 OPAC//cgi-bin/koha/opac-holdshistory.pl 4) Notice it blows up with a 500 error 5) Repeat step 3 Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Rhonda Kuiper <rkuiper@roundrocktexas.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rkuiper@roundrocktexas.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #7 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Raising this to major given the nature of the issue and attention it's gotten. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- No, this must be in Koha::Old::Hold, Koha::Hold reflect the 'reserves' table, and we have a NOT NULL there `biblionumber` int(11) NOT NULL Also, tests are missing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154901|0 |1 is obsolete| | --- Comment #9 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154952 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154952&action=edit Bug 34609: Add biblio method to Old::Hold -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 --- Comment #10 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154953 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154953&action=edit Bug 34609: Add tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154952|0 |1 is obsolete| | --- Comment #11 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 154954 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154954&action=edit Bug 34609: Add biblio method to Old::Hold Test plan, clean k-t-d: 1) Add a reserve to koha/koha user, mysql run: insert into reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, biblionumber) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 76); 2) Add an old_reserve to koha/koha user, mysql run: insert into old_reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, reserve_id) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 1); 3) Visit holdshistory on either OPAC (requires OPACHoldsHistory sys pref) or STAFF STAFF/cgi-bin/koha/members/holdshistory.pl?borrowernumber=1 OPAC//cgi-bin/koha/opac-holdshistory.pl 4) Notice it blows up with a 500 error 5) Repeat step 3 Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Katie Bliss <kebliss@dmpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kebliss@dmpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Jonathan Druart <jonathan.druart+koha@gmail.com> 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=34609 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #154953|0 |1 is obsolete| | Attachment #154954|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 154993 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154993&action=edit Bug 34609: Add tests 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=34609 --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 154994 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154994&action=edit Bug 34609: Add biblio method to Old::Hold Test plan, clean k-t-d: 1) Add a reserve to koha/koha user, mysql run: insert into reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, biblionumber) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 76); 2) Add an old_reserve to koha/koha user, mysql run: insert into old_reserves(borrowernumber, reservedate, branchcode, cancellationdate, timestamp, reserve_id) VALUES (51, '2022-09-23', 'CPL', '2022-09-23', '2022-09-23 15:46:21', 1); 3) Visit holdshistory on either OPAC (requires OPACHoldsHistory sys pref) or STAFF STAFF/cgi-bin/koha/members/holdshistory.pl?borrowernumber=1 OPAC//cgi-bin/koha/opac-holdshistory.pl 4) Notice it blows up with a 500 error 5) Repeat step 3 Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk> 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=34609 --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 154995 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154995&action=edit Bug 34609: Add missing test for Koha::Hold->biblio 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=34609 George Williams (NEKLS) <george@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |george@nekls.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.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=34609 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.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=34609 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #16 from Liz Rea <wizzyrea@gmail.com> --- This can also cause a 500 error when partners go to their Cataloging > Export page. Log will say something like Template process failed: undef error - DBIC result _type isn't of the _type Biblio at /usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/modules/members/holdshistory.tt line 73 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 --- Comment #17 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Liz Rea from comment #16)
This can also cause a 500 error when partners go to their Cataloging > Export page. Log will say something like Template process failed: undef error - DBIC result _type isn't of the _type Biblio at /usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/modules/members/ holdshistory.tt line 73
With this patchset applied that error is also fixed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P2 --- Comment #18 from Liz Rea <wizzyrea@gmail.com> --- Hi may we have a backport to oldstable and oldoldstable please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_22_11_candidate, | |rel_23_05_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 --- Comment #19 from George Williams (NEKLS) <george@nekls.org> --- (In reply to Liz Rea from comment #18)
Hi may we have a backport to oldstable and oldoldstable please?
+1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 --- Comment #20 from Rhonda Kuiper <rkuiper@roundrocktexas.gov> --- Yes, backport please! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|23.11.00 |23.11.00,23.05.04 released in| | --- Comment #21 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00,23.05.04 |23.11.00,23.05.04,22.11.10 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34609 --- Comment #22 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org