[Koha-bugs] [Bug 8842] New: Plack and tools/holidays.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 28 15:15:25 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8842

          Priority: P5 - low
 Change sponsored?: ---
            Bug ID: 8842
                CC: dpavlin at rot13.org
          Assignee: christophe.croullebois at biblibre.com
           Summary: Plack and tools/holidays.pl
          Severity: critical
    Classification: Unclassified
                OS: All
          Reporter: paul.poulain at biblibre.com
          Hardware: All
            Status: ASSIGNED
           Version: master
         Component: Architecture, internals, and plumbing
           Product: Koha

Saving holidays (at least a range) does not work when you're using Plack.

In the logs you see:
Variable "$newoperation" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 86.
Variable "$branchcode" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 86.
Variable "$weekday" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 86.
Variable "$day" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 86.
Variable "$month" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 86.
Variable "$year" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 86.
Variable "$title" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 86.
Variable "$description" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 86.
Variable "@holiday_list" is not available at
/home/paul/koha.dev/koha-community/tools/newHolidays.pl line 117.
Use of uninitialized value $sessiontype in string eq at
/home/paul/koha.dev/koha-community/C4/Auth.pm line 705.


It means there is a sub that uses a variable that is global. When you use
Plack, your script is "wrapped" into a larger sub. So all global variable
become local and the $newoperation are no more available.

The probable solution is to replace

    ($newoperation, $branchcode, $weekday, $day, $month, $year, $title,
$description) = @_;  

by
my     ($newoperation, $branchcode, $weekday, $day, $month, $year, $title,
$description) = @_;

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list