Bug 7871 - Crash on suggestion pages when a budget in use has been deleted
Summary: Crash on suggestion pages when a budget in use has been deleted
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal
Assignee: Adrien SAURAT
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 13:57 UTC by Adrien SAURAT
Modified: 2013-12-05 20:04 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
proposed patch #1 (1.22 KB, patch)
2012-04-03 07:58 UTC, Adrien SAURAT
Details | Diff | Splinter Review
Bug 7871: prevents crash when suggestion linked to erased budget (1.27 KB, patch)
2012-04-09 03:13 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Adrien SAURAT 2012-04-02 13:57:15 UTC
[MT8748]

TEST PLAN:
1) Create a new budget/fund which will be deleted later.

2) Add a suggestion attached to the new fund.

3) Delete the fund.

4) When trying to access the suggestion management pages, koha crashes and display this error message:
Can't use an undefined value as a HASH reference at /home/asaurat/workspace/versions/community/suggestion/suggestion.pl line 208.
Comment 1 Adrien SAURAT 2012-04-03 07:58:44 UTC Comment hidden (obsolete)
Comment 2 Adrien SAURAT 2012-04-03 07:59:52 UTC
Sent a patch preventing the undefined hash problem.

But maybe we should also do that, when a budget is deleted, all linked "budgetid" in suggestions are set to NULL ?
Comment 3 Owen Leonard 2012-04-05 20:00:24 UTC
(In reply to comment #2)
> But maybe we should also do that, when a budget is deleted, all linked
> "budgetid" in suggestions are set to NULL ?

This sounds good to me.
Comment 4 Chris Cormack 2012-04-09 03:13:09 UTC
Created attachment 9033 [details] [review]
Bug 7871: prevents crash when suggestion linked to erased budget

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 5 Ian Walls 2012-04-09 17:30:04 UTC
Breaks out a complex one-liner with lots of assumptions of existence into multiple lines with the proper conditional checks.  Marking Passed QA.
Comment 6 Jared Camins-Esakov 2012-12-31 00:51:59 UTC
There have been no further reports of problems so I am marking this bug resolved.