https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37378

--- Comment #4 from Nick Clemens (kidclamp) <n...@bywatersolutions.com> ---
Created attachment 169412
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169412&action=edit
Bug 37378: libraries_where_can_see_things should always return an array

The subroutine libraries_where_can_see_things stores the list of libraries that
things
can be viewed from in an internal variable, so we can return this directly if
we have already calculated.

When returning if not cached, we dereference the list and return an array. If
cached, we are returning
an arrayref. This patch simply ensures we dereference the array even if already
cached.

Before this patch, we were fetching the patrons, then redacting all info as
their branches didn't match against
an arrayref, rather than checking against each branch we are allowed to view.

To test:
1. Setup a library group and check the "Limit patron data access by group ."
option.
2. Add some libraries to the group. ( IN k-t-d I added CPL and MPL )
3. Create a staff account who has staff access permissions and all of the
borrower permissions except "view_borrower_infos_from_any_libraries"
4. Set the home library of that staff member to one of the branches in step 2.
( In my test I choose MPL )
5. Log in as that patron and attempt a patron search that would include users
from either library in step 2.
6. See the error:

Something went wrong when loading the table.
500: Internal Server Error.
Expected boolean - got null.
Expected boolean - got null.
Expected string - got null.
Expected string - got null.
Expected string - got null.
Expected integer - got null.
Expected integer - got null.
Expected integer - got null.
Expected boolean - got null.
Expected boolean - got null.
Expected string - got null.

7. Apply patch, restart all
8. Search again, you can see the expected patrons

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to