Bug 8834 - Call to C4::Context::preference fails to pass $self in Circulation.pm
Summary: Call to C4::Context::preference fails to pass $self in Circulation.pm
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low normal (vote)
Assignee: Mark Tompsett
QA Contact: Paul Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-27 06:08 UTC by Mark Tompsett
Modified: 2014-05-26 21:05 UTC (History)
5 users (show)

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


Attachments
Change :: to -> to correctly call C4::Context->preference (1.18 KB, patch)
2012-09-27 06:33 UTC, Mark Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8834 - Call to C4::Context::preference fails to pass $self in Circulation.pm (1.20 KB, patch)
2012-10-11 08:38 UTC, Julian Maurice
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-27 06:08:47 UTC
Currently line reads:
    my $circcontrol = C4::Context::preference('CircControl');
This fails to pass $self, which means the line:
    my $var  = lc(shift);  # The system preference to return
which is in C4::Context.pm (sub preference)
triggers the following error log entry:
[Thu Sep 27 12:23:16 2012] [error] [client 192.168.100.2] [Thu Sep 27 12:23:16 2012] renewscript.pl: Use of uninitialized value in lc at /usr/share/koha/lib/C4/Context.pm line 529.

This of course was particularly confusing because the problem is neither in renewscript.pl or Context.pm, but rather Circulation.pm.

This error happens to be in 'sub _debar_user_on_return', which may mean it may or may not affect other user debarred on return bugs. That wasn't what I'm testing for in this bug.

This does not exist in 3.6.x. This was discovered in 3.8.5. This exists in 3.8.x and master.
Comment 1 Mark Tompsett 2012-09-27 06:33:37 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2012-09-27 06:36:12 UTC
Actually, if it bug 8251 has already been pushed, the patch should apply fine. I  just did this up from the latest master, and tested applying against the latest 3.8.x.
Comment 3 Julian Maurice 2012-10-11 08:35:56 UTC
This is not an enhancement.
Changed severity to normal.
Comment 4 Julian Maurice 2012-10-11 08:38:55 UTC
Created attachment 12768 [details] [review]
[SIGNED-OFF] Bug 8834 - Call to C4::Context::preference fails to pass $self in Circulation.pm

Changed:
    my $circcontrol = C4::Context::preference('CircControl');
To:
    my $circcontrol = C4::Context->preference('CircControl');
This will pass $self and 'CircControl' which will then prevent
a "Use of uninitialized value" error log entry.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 5 Paul Poulain 2012-10-24 16:21:13 UTC
QA comment: tiny and obvious patch

passed QA
Comment 6 Paul Poulain 2012-10-24 16:21:36 UTC
Patch pushed to master
Comment 7 Chris Cormack 2012-10-24 20:26:57 UTC
Pushed to 3.8.x will be in 3.8.7