Bug 25875 - Patron displayed multiple times in add user search if they have multiple sub permissions
Summary: Patron displayed multiple times in add user search if they have multiple sub ...
Status: Pushed to oldoldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 24964
Blocks:
  Show dependency treegraph
 
Reported: 2020-06-25 10:37 UTC by Nick Clemens
Modified: 2020-07-26 15:49 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.02, 19.11.08, 19.05.14


Attachments
Bug 25875: Unit test (1.62 KB, patch)
2020-06-25 10:40 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25875: Move check for module_bit and code to the JOIN (2.63 KB, patch)
2020-06-25 10:40 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25875: Unit test (1.62 KB, patch)
2020-06-25 11:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25875: Move check for module_bit and code to the JOIN (2.68 KB, patch)
2020-06-25 11:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25875: Unit test (2.12 KB, patch)
2020-06-26 14:51 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 25875: Move check for module_bit and code to the JOIN (2.73 KB, patch)
2020-06-28 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25875: Unit test (2.17 KB, patch)
2020-06-28 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-06-25 10:37:35 UTC
To recreate:
1 - Give a patron full acquisitions permissions
2 - Also give them several subpermissions on other areas
3 - Go to Acquisitions
4 - Edit a fund
5 - Add a user to the fund
6 - Search for user above
7 - They return multiple times in results
Comment 1 Nick Clemens 2020-06-25 10:40:14 UTC
Created attachment 106283 [details] [review]
Bug 25875: Unit test
Comment 2 Nick Clemens 2020-06-25 10:40:17 UTC
Created attachment 106284 [details] [review]
Bug 25875: Move check for module_bit and code to the JOIN

If we limit the JOIN to rows with the correct subpermission we won't
duplicate the returned patrons

To test:
 1 - Give a patron full acquisitions permissions
 2 - Also give them several subpermissions on other areas
 3 - Go to Acquisitions
 4 - Edit a fund
 5 - Add a user to the fund
 6 - Search for user above
 7 - They return multiple times in results
 8 - Apply patch
 9 - Restart all the things
10 - Repeat search
11 - Patron appears once
Comment 3 Owen Leonard 2020-06-25 11:02:56 UTC
Created attachment 106285 [details] [review]
Bug 25875: Unit test
Comment 4 Owen Leonard 2020-06-25 11:02:59 UTC
Created attachment 106286 [details] [review]
Bug 25875: Move check for module_bit and code to the JOIN

If we limit the JOIN to rows with the correct subpermission we won't
duplicate the returned patrons

To test:
 1 - Give a patron full acquisitions permissions
 2 - Also give them several subpermissions on other areas
 3 - Go to Acquisitions
 4 - Edit a fund
 5 - Add a user to the fund
 6 - Search for user above
 7 - They return multiple times in results
 8 - Apply patch
 9 - Restart all the things
10 - Repeat search
11 - Patron appears once

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Julian Maurice 2020-06-26 13:40:30 UTC
Unit tests pass even without the 2nd patch, can you take a look Nick please ?
Comment 6 Nick Clemens 2020-06-26 14:51:40 UTC
Created attachment 106341 [details] [review]
Bug 25875: Unit test
Comment 7 Katrin Fischer 2020-06-28 21:42:26 UTC
Created attachment 106363 [details] [review]
Bug 25875: Move check for module_bit and code to the JOIN

If we limit the JOIN to rows with the correct subpermission we won't
duplicate the returned patrons

To test:
 1 - Give a patron full acquisitions permissions
 2 - Also give them several subpermissions on other areas
 3 - Go to Acquisitions
 4 - Edit a fund
 5 - Add a user to the fund
 6 - Search for user above
 7 - They return multiple times in results
 8 - Apply patch
 9 - Restart all the things
10 - Repeat search
11 - Patron appears once

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Katrin Fischer 2020-06-28 21:42:30 UTC
Created attachment 106364 [details] [review]
Bug 25875: Unit test

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Jonathan Druart 2020-06-29 11:50:59 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 10 Lucas Gass 2020-07-13 16:25:29 UTC
backported to 20.05.x for 20.05.02
Comment 11 Aleisha Amohia 2020-07-16 04:38:02 UTC
backported to 19.11.x for 19.11.08
Comment 12 Victor Grousset/tuxayo 2020-07-26 15:49:14 UTC
Backported to 19.05.x branch for 19.05.14