Summary: | CheckReserves dies if itype doesn't exist | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Architecture, internals, and plumbing | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | Pushed to stable --- | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | normal | ||
Priority: | P5 - low | CC: | m.de.rooy, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
25.11.00,25.05.01
|
Circulation function: | |
Attachments: |
Bug 40034: Regression tests
Bug 40034: Only check notforloan on itemtype if it exists Bug 40034: Regression tests Bug 40034: Only check notforloan on itemtype if it exists Bug 40034: Regression tests Bug 40034: Only check notforloan on itemtype if it exists |
Description
Tomás Cohen Arazi (tcohen)
2025-05-30 12:30:40 UTC
Created attachment 182908 [details] [review] Bug 40034: Regression tests Created attachment 182909 [details] [review] Bug 40034: Only check notforloan on itemtype if it exists This patch makes the code in `CheckReserves` survive the non-existence of the referenced item type in the `items` table for the passed item. To test: 1. Apply the regression tests 2. Run: $ ktd --shell k$ prove t/db_dependent/Reserves.t => FAIL: Tests explode like this: ``` Can't call method "notforloan" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 870. ``` 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Created attachment 182913 [details] [review] Bug 40034: Regression tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 182914 [details] [review] Bug 40034: Only check notforloan on itemtype if it exists This patch makes the code in `CheckReserves` survive the non-existence of the referenced item type in the `items` table for the passed item. To test: 1. Apply the regression tests 2. Run: $ ktd --shell k$ prove t/db_dependent/Reserves.t => FAIL: Tests explode like this: ``` Can't call method "notforloan" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 870. ``` 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Created attachment 183042 [details] [review] Bug 40034: Regression tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 183043 [details] [review] Bug 40034: Only check notforloan on itemtype if it exists This patch makes the code in `CheckReserves` survive the non-existence of the referenced item type in the `items` table for the passed item. To test: 1. Apply the regression tests 2. Run: $ ktd --shell k$ prove t/db_dependent/Reserves.t => FAIL: Tests explode like this: ``` Can't call method "notforloan" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 870. ``` 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Nice work everyone! Pushed to main for 25.11 Nice work everyone! Pushed to 25.05.x for 25.05.03 |