Bug 30251: (bug 10902 follow-up) With IndependentBranches non-superlibrarians do...
authorJanusz Kaczmarek <januszop@gmail.com>
Tue, 8 Mar 2022 21:42:44 +0000 (22:42 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 25 Mar 2022 21:01:04 +0000 (11:01 -1000)
commit9abd94b2516d979887e19b7dc7bfbbe1e8a7e533
tree5b4a63a5d2cdbb32cd0c078d32cc8ac59c408b92
parentac9a41c7c9b393d5ec58ca6c4871131c3a934720
Bug 30251: (bug 10902 follow-up) With IndependentBranches non-superlibrarians do not get autocomplete list in circulation module

Having IndependentBranches on, a librarian who is not superlibrarian
does not get a autocomplete hint list when entering a part of the
patron's name (while performing check out, etc.)  Koha registers
an error:

DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st
execute failed: Column 'branchcode' in where clause is ambiguous at
.../Koha/Objects.pm line 312

This is due to fix to the bug 10902 -- addig "prefetch => 'branchcode'" to
the attributes of the query in circ/ysearch.pl, while having branchcode
in the search parameters.

Test plan:
----------

1. Have IndependentBranches on, PatronAutoComplete set to 'Try.
   Be a librarian without superlibrarian privileges.  Have some
   patrons defined.
2. In the main input field on the top, with Check out active, try to
   put 3+ characters from the known user name/cardnumber etc. You
   will get no hint.
3. Apply the patch.
4. Repeat 2.  You should now see an autocomplete hint list.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
circ/ysearch.pl