Bug 15810 - Can't create private lists if OpacAllowPublicListCreation is set to 'not allow'
Summary: Can't create private lists if OpacAllowPublicListCreation is set to 'not allow'
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 15811
  Show dependency treegraph
 
Reported: 2016-02-12 14:22 UTC by Katrin Fischer
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15810: Make sure the CGI->param is not called in a list context when creating private shelves (3.68 KB, patch)
2016-02-12 14:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 15810: Make sure the CGI->param is not called in a list context when creating private shelves (3.75 KB, patch)
2016-02-12 14:50 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15810: Make sure the CGI->param is not called in a list context when creating private shelves (3.79 KB, patch)
2016-02-19 13:53 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2016-02-12 14:22:44 UTC
If you try to create a private list from the OPAC and the OpacAllowPublicListCreation is set to 'not allow' public lists to be created by the patron, an error occurs:

Koha::Schema::Result::Virtualshelve at  /usr/share/koha/lib/Koha/Object.pm line
Comment 1 Jonathan Druart 2016-02-12 14:38:34 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2016-02-12 14:50:13 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2016-02-19 12:31:41 UTC
I cannot re-create this bug. Is the test plan incomplete, or has this been fixed in master incidentally?
Comment 4 Katrin Fischer 2016-02-19 12:34:41 UTC
We have tested this on 3.22.3 - there it's definitely a problem. 
Have you set the system preference? It will hide several options from the form.
Comment 5 Kyle M Hall 2016-02-19 12:36:22 UTC
(In reply to Katrin Fischer from comment #4)
> We have tested this on 3.22.3 - there it's definitely a problem. 
> Have you set the system preference? It will hide several options from the
> form.

Yes, I enabled the syspref which made "private" the only list option available. Can you confirm you can recreate the bug on master?
Comment 6 Katrin Fischer 2016-02-19 12:37:47 UTC
Sorry - can't check right now, will try later.
Comment 7 Kyle M Hall 2016-02-19 13:43:56 UTC
(In reply to Katrin Fischer from comment #6)
> Sorry - can't check right now, will try later.

Confirmed the bug. I was looking in the wrong place ; )
Comment 8 Katrin Fischer 2016-02-19 13:49:10 UTC
Yay! something off the to-do list :)
Comment 9 Kyle M Hall 2016-02-19 13:53:54 UTC
Created attachment 48232 [details] [review]
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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Brendan Gallagher 2016-02-22 20:33:09 UTC
pushed to master - should be in the may 2016 release. thanks
Comment 11 Julian Maurice 2016-02-26 09:58:58 UTC
Patch pushed to 3.22.x, will be in 3.22.4