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) = @_;
Created attachment 13186 [details] [review] Bug 8842 fix Plack scoping for holidays the internal sub add_holiday uses some variables that are defined in the main script, usual fix
Upgrading severity, it's a Blocker for Plack users
Created attachment 13187 [details] [review] Bug 8842 fix Plack scoping in acquisition basket.pl has a local sub get_order_infos that require our-ing the $basketno variable Note that I had no problem with this variable. It may be some dead code, but I couldn't be sure it is, so I just switched basketno to "our" neworderempty.pl has 2 local sub that require our-ing some variables: subs MARCfindbreeding and Load_Duplicate
Comment on attachment 13187 [details] [review] Bug 8842 fix Plack scoping in acquisition oops... wrong bug, it's 8892, not 8842. Will attach this one to the correct bug
Created attachment 13199 [details] [review] Bug 8842 fix Plack scoping for holidays the internal sub add_holiday uses some variables that are defined in the main script, usual fix Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
QA Comment: This patch fixes the issue using plack and does not introduce regression. Marked as Passed QA.
This patch has been pushed to master.
Patch pushed to branch 3.10.x
Released in 3.10.0