Bug 17901: Force context to scalar
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 13 Jan 2017 16:07:34 +0000 (17:07 +0100)
committerJulian Maurice <julian.maurice@biblibre.com>
Mon, 30 Jan 2017 15:28:58 +0000 (16:28 +0100)
See bug 15809 for more references.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit cb4fa17a2712d04590d218635913bfe794510615)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

opac/opac-shelves.pl

index 729e3a0..658e3ea 100755 (executable)
@@ -104,12 +104,12 @@ if ( $op eq 'add_form' ) {
         my $sortfield = $query->param('sortfield');
         $sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber );
         if ( $shelf->can_be_managed( $loggedinuser ) ) {
-            $shelf->shelfname( $query->param('shelfname') );
+            $shelf->shelfname( scalar $query->param('shelfname') );
             $shelf->sortfield( $sortfield );
-            $shelf->allow_add( $query->param('allow_add') );
-            $shelf->allow_delete_own( $query->param('allow_delete_own') );
-            $shelf->allow_delete_other( $query->param('allow_delete_other') );
-            $shelf->category( $query->param('category') );
+            $shelf->allow_add( scalar $query->param('allow_add') );
+            $shelf->allow_delete_own( scalar $query->param('allow_delete_own') );
+            $shelf->allow_delete_other( scalar $query->param('allow_delete_other') );
+            $shelf->category( scalar $query->param('category') );
             eval { $shelf->store };
 
             if ($@) {