Bugzilla – Attachment 47985 Details for
Bug 15810
Can't create private lists if OpacAllowPublicListCreation is set to 'not allow'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 15810: Make sure the CGI->param is not called in a list context when creating private shelves
SIGNED-OFF-Bug-15810-Make-sure-the-CGI-param-is-no.patch (text/plain), 3.75 KB, created by
Katrin Fischer
on 2016-02-12 14:50:13 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 15810: Make sure the CGI->param is not called in a list context when creating private shelves
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-02-12 14:50:13 UTC
Size:
3.75 KB
patch
obsolete
>From 6d969e8b53664f3aacb47d8e13b0cf847fd6f629 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 12 Feb 2016 14:33:57 +0000 >Subject: [PATCH] [SIGNED OFF] Bug 15810: Make sure the CGI->param is not > called in a list context when creating private shelves > >This patch fixes the following bug: >If OpacAllowPublicListCreation is set to "not allow", the creation of a >private list raises an error at the OPAC. > >CGI->param is called in a list context and some parameters are not >filled from the template if the pref is set to "not allow". >To make sure we don't have a "Odd number of elements in anonymous hash", >we force the context to scalar. > >Test plan: >1/ Set OpacAllowPublicListCreation to "not allow" >2/ Create private and public lists at the OPAC and the intranet >=> Everything should work fine with this patch applied > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > opac/opac-shelves.pl | 14 +++++++------- > virtualshelves/shelves.pl | 14 +++++++------- > 2 files changed, 14 insertions(+), 14 deletions(-) > >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index 76d632a..ef418e0 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -72,13 +72,13 @@ if ( $op eq 'add_form' ) { > if ( $loggedinuser ) { > eval { > $shelf = Koha::Virtualshelf->new( >- { shelfname => $query->param('shelfname'), >- sortfield => $query->param('sortfield'), >- category => $query->param('category') || 1, >- allow_add => $query->param('allow_add'), >- allow_delete_own => $query->param('allow_delete_own'), >- allow_delete_other => $query->param('allow_delete_other'), >- owner => $loggedinuser, >+ { shelfname => scalar $query->param('shelfname'), >+ sortfield => scalar $query->param('sortfield'), >+ category => scalar $query->param('category') || 1, >+ allow_add => scalar $query->param('allow_add'), >+ allow_delete_own => scalar $query->param('allow_delete_own'), >+ allow_delete_other => scalar $query->param('allow_delete_other'), >+ owner => scalar $loggedinuser, > } > ); > $shelf->store; >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index 74e31e4..eab6c17 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -65,13 +65,13 @@ if ( $op eq 'add_form' ) { > } elsif ( $op eq 'add' ) { > eval { > $shelf = Koha::Virtualshelf->new( >- { shelfname => $query->param('shelfname'), >- sortfield => $query->param('sortfield'), >- category => $query->param('category'), >- allow_add => $query->param('allow_add'), >- allow_delete_own => $query->param('allow_delete_own'), >- allow_delete_other => $query->param('allow_delete_other'), >- owner => $query->param('owner'), >+ { shelfname => scalar $query->param('shelfname'), >+ sortfield => scalar $query->param('sortfield'), >+ category => scalar $query->param('category'), >+ allow_add => scalar $query->param('allow_add'), >+ allow_delete_own => scalar $query->param('allow_delete_own'), >+ allow_delete_other => scalar $query->param('allow_delete_other'), >+ owner => scalar $query->param('owner'), > } > ); > $shelf->store; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15810
:
47981
|
47985
|
48232