Bug 8490: fix Plack error when creating label layout
authorPaul Poulain <paul.poulain@biblibre.com>
Fri, 2 Nov 2012 11:16:19 +0000 (12:16 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Mon, 5 Nov 2012 13:35:06 +0000 (08:35 -0500)
This patch fixes "Error message "Can't bless non-reference value at
/home/pi/koha/C4/Creators/Layout.pm line 111." when trying to add a
label layout while using plack."

The $layout_id variable is set to 5001 on my setup. And 5001 is the Unix
port where I run Plack. WTH is this value stored in this variable ?
Because of
> my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || $ARGV[1] || '';
in label-edit-layout.pl

Removing $ARGV[1] solves the problem
Also removing $ARG[0] because I also don't think it's useful

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed off after confirming with Chris Nighswonger that these scripts
were not intended to be run from the command line. Works as promised.

Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

labels/label-edit-layout.pl

index 268912c..e814e3b 100755 (executable)
@@ -41,8 +41,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $op = $cgi->param('op') || $ARGV[0] || '';
-my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || $ARGV[1] || '';
+my $op = $cgi->param('op') || '';
+my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || '';
 my $layout_choice = $cgi->param('layout_choice') || '';
 our $layout = '';