Bug 20998

Summary: Non superlibrarians cannot search for patrons using the quicksearch at the top
Product: Koha Reporter: Nick Clemens <nick>
Component: Staff interfaceAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: critical    
Priority: P5 - low CC: barton, fridolin.somers, gmcharlt, jonathan.druart, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17829    
Bug Blocks:    
Attachments: Bug 20998: Only perform quicksearch if patron found with cardnumber
Bug 20998: Only perform quicksearch if patron found with cardnumber
Bug 20998: Simplify the conditional statement
Bug 20998: Only perform quicksearch if patron found with cardnumber
Bug 20998: Simplify the conditional statement
Bug 20998: Only perform quicksearch if patron found with cardnumber
Bug 20998: Simplify the conditional statement

Description Nick Clemens 2018-06-26 15:01:49 UTC
To recreate:
1 - Enable 'IndependentBranches'
2 - Setup a patron with all permissions, but not a superlibrarian
3 - Login to staff client as that patron
4 - Click 'Patrons' in the toolbar and try a search
5 - Internal server error
Comment 1 Nick Clemens 2018-06-26 15:04:32 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2018-06-26 15:37:47 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2018-06-26 15:37:50 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2018-06-26 15:39:23 UTC
Upping severity, that's clearly critical for installations with IndependentBranches.
I have added a follow-up to simplify the conditional statement.

Caused by
  commit 2b90ea2cb0e5e976de7ddef0151ae83d8ac578e6
  Bug 17829: Move GetMember to Koha::Patron
Comment 5 Owen Leonard 2018-06-26 17:50:11 UTC
Created attachment 76466 [details] [review]
Bug 20998: Only perform quicksearch if patron found with cardnumber

This patch makes sure we have a patron before we try to access their
branchcode and allows search to work

To recreate:
1 - Enable 'IndependentBranches'
2 - Setup a patron with all permissions, but not a superlibrarian
3 - Login to staff client as that patron
4 - Click 'Patrons' in the toolbar and try a search
5 - Internal server error
6 - Apply patch
7 - Try the search again
8 - Success!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2018-06-26 17:50:15 UTC
Created attachment 76467 [details] [review]
Bug 20998: Simplify the conditional statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Tomás Cohen Arazi 2018-06-27 14:20:49 UTC
Created attachment 76517 [details] [review]
Bug 20998: Only perform quicksearch if patron found with cardnumber

This patch makes sure we have a patron before we try to access their
branchcode and allows search to work

To recreate:
1 - Enable 'IndependentBranches'
2 - Setup a patron with all permissions, but not a superlibrarian
3 - Login to staff client as that patron
4 - Click 'Patrons' in the toolbar and try a search
5 - Internal server error
6 - Apply patch
7 - Try the search again
8 - Success!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Tomás Cohen Arazi 2018-06-27 14:20:54 UTC
Created attachment 76518 [details] [review]
Bug 20998: Simplify the conditional statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Nick Clemens 2018-06-29 21:01:12 UTC
Awesome work all!

Pushed to master for 18.11
Comment 10 Barton Chittenden 2018-06-29 23:01:17 UTC
Request for back-port (issue first occurs in 17.11, I believe)
Comment 11 Martin Renvoize 2018-07-02 07:18:29 UTC
Pushed to 18.05.x for 18.05.02
Comment 12 Fridolin Somers 2018-07-04 06:50:16 UTC
Pushed to 17.11.x for 17.11.08
Comment 13 Fridolin Somers 2018-07-04 06:54:08 UTC
Depends on Bug 17829 not in 17.05.x