[Bug 41510] New: Fallback on bookable itemtype can break if item has no itemtype
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41510 Bug ID: 41510 Summary: Fallback on bookable itemtype can break if item has no itemtype Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: paul.derscheid@lmscloud.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com I think this is a rare case, but we need to guard against it. -- 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=41510 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=41510 --- Comment #1 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 190820 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190820&action=edit Bug 41510: Add test for effective_bookable with missing itemtype - Add test case for the scenario where an item has no itemtype because both items.itype and biblioitems.itemtype are NULL - Note: We must set biblioitems.itemtype to NULL before creating the item because Koha::Item->store() automatically populates itype from biblioitems.itemtype when itype is not set Test plan: - Apply this patch only - Run: prove t/db_dependent/Koha/Item.t :: effective_bookable - Verify test 6 FAILS with "Can't call method 'bookable' on an undefined value" - Apply the follow-up patch - Run the test again - Verify all tests PASS -- 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=41510 --- Comment #2 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 190821 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190821&action=edit Bug 41510: Handle undefined itemtype in item->effective_bookable - Guard against undefined itemtype before calling ->bookable on it - Return 0 (not bookable) when no itemtype is found and item-level bookable is not defined -- 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=41510 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. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41510 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190820|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 190854 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190854&action=edit Bug 41510: Add test for effective_bookable with missing itemtype - Add test case for the scenario where an item has no itemtype because both items.itype and biblioitems.itemtype are NULL - Note: We must set biblioitems.itemtype to NULL before creating the item because Koha::Item->store() automatically populates itype from biblioitems.itemtype when itype is not set Test plan: - Apply this patch only - Run: prove t/db_dependent/Koha/Item.t :: effective_bookable - Verify test 6 FAILS with "Can't call method 'bookable' on an undefined value" - Apply the follow-up patch - Run the test again - Verify all tests PASS Signed-off-by: David Nind <david@davidnind.com> -- 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=41510 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190821|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 190855 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190855&action=edit Bug 41510: Handle undefined itemtype in item->effective_bookable - Guard against undefined itemtype before calling ->bookable on it - Return 0 (not bookable) when no itemtype is found and item-level bookable is not defined Signed-off-by: David Nind <david@davidnind.com> -- 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=41510 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |paul.derscheid@lmscloud.de |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=41510 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41510 Kyle M Hall (khall) <kyle@bywatersolutions.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=41510 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk Text to go in the| |Catches the unlikely case release notes| |of there not being an | |itemtype associated with | |item or bib for bookings. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41510 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41510 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41510 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Thanks for all the hard work! Pushed to main for the next 26.05.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41510 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41510 --- Comment #6 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org