[Bug 21738] New: [ILS-DI] error while holding a title without item
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Bug ID: 21738 Summary: [ILS-DI] error while holding a title without item Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Web services Assignee: koha-bugs@lists.koha-community.org Reporter: alex.arnaud@biblibre.com QA Contact: testopia@bugs.koha-community.org Using ILS-DI's HoldTitle service, if we request for holding a title which has no item, we get this error: Can't use an undefined value as a HASH reference at /kohaclone/C4/ILSDI/Services.pm line 670 http://catalog.kohaclone/cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=1&bib_id=1&request_location=127.0.0.1 -- 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=21738 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |alex.arnaud@biblibre.com |ity.org | -- 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=21738 --- Comment #1 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 81754 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81754&action=edit Bug 21738: Move counting of items in C4::Reserves::CanBookBeReserved Test plan: - Try holding a title without items via ILS-DI => error, - try the same via UI => message is "Cannot place hold: this record has no items attached." - apply this patch, - try to hold a title without items via ILS-DI => "<code>NotHoldable</code>", - try again via UI => message is still "<code>NotHoldable</code>" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Alex Arnaud <alex.arnaud@biblibre.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=21738 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- If I hit /reserve/request.pl?biblionumbers=1/2/3&multi_hold=1 I see: https://snag.gy/myA5aP.jpg The patron search box should not be there. If I search for a patron, I get: https://snag.gy/tuRJb1.jpg -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81754|0 |1 is obsolete| | --- Comment #3 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 82251 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82251&action=edit Bug 21738: check items count in C4:ILSDI::HoldTitle Test plan: - Try holding a title without items via ILS-DI (cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=1&bib_id=1), - you get an error, - apply this patch, - try again, - you should get the code "Notitems"Bug 21738: check items count in C4:ILSDI::HoldTitle -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #4 from Alex Arnaud <alex.arnaud@biblibre.com> --- The patch above is a replacement one. Since we need to know the number of items before having the patron making the request, we can't check items count in CanBookBeReserved. So i simply write the same test in ILSDI::HoldTitle than in reserve/request.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15524 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- This is a regression since 18.05, we need it into 18.11 Caused by commit 5f485e476b2c5521d59bda6d48b56ed36cff3f86 Bug 15524: (QA follow-up) Change Can[Book|Item]BeReserved to return hashref, pass limit to template Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15524 [Bug 15524] Set limit on maximum possible holds per patron by category -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I am wondering if we should not move $canReserve->{status} //= '' from reserve/request.pl to CanBookBeReserved That will make the calls to CanBookBeReserved safe. Kyle, what are your thoughts about that? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #6)
I am wondering if we should not move $canReserve->{status} //= '' from reserve/request.pl to CanBookBeReserved
That will make the calls to CanBookBeReserved safe.
Kyle, what are your thoughts about that?
Yes, that sounds like a good idea to me! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |m.de.rooy@rijksmuseum.nl --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- return { code => 'NotHoldable' } unless CanBookBeReserved( $borrowernumber, $biblionumber )->{status} eq 'OK'; This line just needs attention imo. If there are no items, you may get back an undef. So just check that. And do not assume you have a hash. No need to duplicate the hostitems stuff at all? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 --- Comment #9 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 83637 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83637&action=edit Bug 21738: make call of CanBookBeReserved more safe -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Alex Arnaud <alex.arnaud@biblibre.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=21738 Alex Arnaud <alex.arnaud@biblibre.com> 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=21738 Kyle M Hall <kyle@bywatersolutions.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=21738 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #82251|0 |1 is obsolete| | Attachment #83637|0 |1 is obsolete| | --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 83752 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83752&action=edit Bug 21738: check items count in C4:ILSDI::HoldTitle Test plan: - Try holding a title without items via ILS-DI (cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=1&bib_id=1), - you get an error, - apply this patch, - try again, - you should get the code "Notitems"Bug 21738: check items count in C4:ILSDI::HoldTitle Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 83753 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83753&action=edit Bug 21738: make call of CanBookBeReserved more safe Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Summary|[ILS-DI] error while |[ILS-DI] Error placing a |holding a title without |hold on a title without |item |item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=21738 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83752|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 84673 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84673&action=edit Bug 21738: check items count in C4:ILSDI::HoldTitle Test plan: - Try holding a title without items via ILS-DI (cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=1&bib_id=1), - you get an error, - apply this patch, - try again, - you should get the code "Notitems"Bug 21738: check items count in C4:ILSDI::HoldTitle Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83753|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 84674 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84674&action=edit Bug 21738: make call of CanBookBeReserved more safe Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Passed QA |Failed QA --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- Tests for changes to HoldTitle? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Nick Clemens from comment #14)
Tests for changes to HoldTitle?
You are right! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 --- Comment #16 from Alex Arnaud <alex.arnaud@biblibre.com> --- Created attachment 84853 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84853&action=edit Bug 21738: unit tests for HoldTitle -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 --- Comment #17 from Alex Arnaud <alex.arnaud@biblibre.com> --- Set it back to Passed QA. An other QAer for checking unit tests ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #18 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21738 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED CC| |martin.renvoize@ptfs-europe | |.com Resolution|--- |FIXED --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Bug in enhancement not in 18.11.x series. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org