Bug 7871

Summary: Crash on suggestion pages when a budget in use has been deleted
Product: Koha Reporter: Adrien SAURAT <adrien.saurat>
Component: AcquisitionsAssignee: Adrien SAURAT <adrien.saurat>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: normal    
Priority: P5 - low CC: chris, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
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
Bug 7871: prevents crash when suggestion linked to erased budget

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.