Bug 8826 - Initialization of hash triggers error log entries.
Summary: Initialization of hash triggers error log entries.
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Mark Tompsett
QA Contact: Paul Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-26 08:40 UTC by Mark Tompsett
Modified: 2013-12-05 20:01 UTC (History)
6 users (show)

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


Attachments
Changed {} to () in initialization of variable. (1003 bytes, patch)
2012-09-27 07:59 UTC, Mark Tompsett
Details | Diff | Splinter Review
Changed {} to () in initialization of variable. (3.8.x) (999 bytes, patch)
2012-09-27 08:01 UTC, Mark Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8826 - Initialization of hash triggers error log entries. (1.03 KB, patch)
2012-09-28 13:18 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 8826 - Initialization of hash triggers error log entries - Followup (820 bytes, patch)
2012-09-28 13:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 8826 - Initialization of hash triggers error log entries - Followup (833 bytes, patch)
2012-11-01 06:59 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 Mark Tompsett 2012-09-26 08:40:43 UTC
Bug 7851 initialized a hash incorrectly.
our %renew_failed = {};
This attempts to create a hash of a single anonymous hash reference which generates the error:
circulation.pl: Reference found where even-sized list expected at /usr/share/koha/intranet/cgi-bin/circ/circulation.pl line 97.

As I do not know how my proposed change of:
our %renew_failed = ();
will work in a plack context, I would need someone to assist in testing that.

I was thinking of reverting to no initialization, but based on my reading of bug 7851, that isn't an option.

In the worst case scenario:
our %renew_failed = ( "dummyplaceholderkey" => "dummyplaceholdervalue" );
should work.

This only applies to 3.8.x and master, as 3.6.x still has an uninitialized value (which should not be problematic as far as I can tell).
Comment 1 Mark Tompsett 2012-09-27 07:59:54 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2012-09-27 08:01:39 UTC
Created attachment 12544 [details] [review]
Changed {} to () in initialization of variable. (3.8.x)

Changes between 3.8.x and master require a separate patch to apply cleanly. The test plan should be the same as master.
Comment 3 Kyle M Hall 2012-09-28 13:18:57 UTC
Created attachment 12581 [details] [review]
[SIGNED-OFF] Bug 8826 - Initialization of hash triggers error log entries.

Changed:
our %renew_failed = {};
To:
our %renew_failed = ();
This prevents an error log about Reference found where
even-sized list expected.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Kyle M Hall 2012-09-28 13:20:23 UTC Comment hidden (obsolete)
Comment 5 Mark Tompsett 2012-10-05 11:41:56 UTC
Thanks for catching the follow up, Kyle. I was just about to add that.
Comment 6 Kyle M Hall 2012-10-05 12:10:50 UTC
(In reply to comment #5)
> Thanks for catching the follow up, Kyle. I was just about to add that.

No problem! Can you give it a test and a sign-off?
Comment 7 Chris Cormack 2012-11-01 06:59:20 UTC
Created attachment 13165 [details] [review]
Bug 8826 - Initialization of hash triggers error log entries - Followup

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 8 Paul Poulain 2012-11-02 11:20:18 UTC
QA comment: tiny (2 lines) patch, passes QA
Comment 9 Jared Camins-Esakov 2012-11-02 16:13:12 UTC
This patch has been pushed to master.
Comment 10 Paul Poulain 2012-11-02 16:46:00 UTC
Patch pushed to branch 3.10.x
Comment 11 Chris Cormack 2012-11-02 17:19:17 UTC
3.8.x patch pushed, will be in 3.8.7
Comment 12 Liz Rea 2012-11-28 01:47:22 UTC
Patches do not apply to 3.6.x, please reopen and submit a patch for 3.6.x if necessary. 

Thanks!
Comment 13 Mark Tompsett 2012-11-28 18:44:59 UTC
Bug 8880 includes the changes here in 8826. So if 8880 has been been applied to 3.6.x then that explains why this can't be applied. I haven't looked further yet.