| Summary: | Holds: Can't call method "notforloan" on an undefined value when placing a hold | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
| Component: | Hold requests | Assignee: | Marcel de Rooy <m.de.rooy> |
| Status: | CLOSED FIXED | QA Contact: | Tomás Cohen Arazi (tcohen) <tomascohen> |
| Severity: | minor | ||
| Priority: | P5 - low | CC: | andrew, gmcharlt, kyle, tomascohen, victor |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29554 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | Trivial patch | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: |
22.05.00,21.11.02.21.05.09
|
Circulation function: | |
| Attachments: |
Bug 29553: Fix crash on undefined notforloan value
Bug 29553: Fix crash on undefined notforloan value Bug 29553: Fix crash on undefined notforloan value Bug 29553: Regression tests Bug 29553: (QA follow-up) Check defined instead of evaluating as boolean |
||
Created attachment 127925 [details] [review] Bug 29553: Fix crash on undefined notforloan value Test plan: Set item level itypes to biblioitems. Find a record with itemtype NULL, having an item. Place a hold. Without this patch, it crashes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 128122 [details] [review] Bug 29553: Fix crash on undefined notforloan value Test plan: Set item level itypes to biblioitems. Find a record with itemtype NULL, having an item. Place a hold. Without this patch, it crashes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com> (In reply to Thibaud Guillot from comment #2) > Created attachment 128122 [details] [review] [review] > Bug 29553: Fix crash on undefined notforloan value > > Test plan: > Set item level itypes to biblioitems. > Find a record with itemtype NULL, having an item. > Place a hold. Without this patch, it crashes. > > Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com> Thx Thibaud. I will adjust the patch status accordingly. Created attachment 128681 [details] [review] Bug 29553: Fix crash on undefined notforloan value Test plan: Set item level itypes to biblioitems. Find a record with itemtype NULL, having an item. Place a hold. Without this patch, it crashes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 128682 [details] [review] Bug 29553: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 128683 [details] [review] Bug 29553: (QA follow-up) Check defined instead of evaluating as boolean Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Pushed to master for 22.05, thanks to everybody involved [U+1F984] Pushed to 21.11.x for 21.11.02 Pushed to 21.05.x for 21.05.09 Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed. |
C4::Reserves::IsAvailableForItemLevelRequest my $itemtype = $item->effective_itemtype; my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; If you have set item level itypes to biblioitems, but your biblioitem record has itemtype NULL, placing a hold will crash. (You must have an item too.)