[Koha-bugs] [Bug 23830] Koha::AuthorisedValues should use Koha::Objects::Limit::Library

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 2 09:02:29 CET 2021


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #115990|0                           |1
        is obsolete|                            |

--- Comment #4 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 116186
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116186&action=edit
Bug 23830: Adapt callers

This patch is the result of making the same changes we did on the
t/db_dependent/AuthorisedValues.t file (replacing the calls to
Koha::AuthorisedValues->search with the tricky branchcode param, and
call ->search_with_library_limits, with the library_id as a third
parameter.

What I did was:
   $ git grep 'Koha::AuthorisedValues\->search'

and then revisited each of the grep results to check if they added the
'branchcode' parameter to the filters.

This patch changes the calls to ->search, for
->search_with_library_limits in all the places that require it in the
current codebase [1].

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Charges/Sales.t \
           t/db_dependent/Ill*
3. Verify the batchmod.pl script is working and filtering the authorised
   values keeps working

[1] Some places like the Koha/Template/Plugin/AuthorisedValues.pm plugin
don't seem to be tested, at first glance.

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list