Koha/circ
Fridolin Somers 889ba1c381 Bug 30735: Fix filtering by patron attribute with AV in overdues report
In Circulation > Overdues, if there are seachable patron attributes
they can be used in left filters. Search does not work if this attribute
is linked to an authorized values category.

The problem is that AV code is compared to the AV desciption in :
  if (grep { $attrval eq lc($_->[1]) } @{ $pattrs->{$code} }) {

Looking at a Data::Dumper of the var $pattrs you see for example :
$VAR1 = {
          'ATT1' => [
                      [
                        'afr',
                        'Afrikaans'
                      ]
                    ]
        };
First row is attribute code and second row is desciption.
It works for an attribute without AV because in this case
'avdescription' is undefined so code is stored as description :
          push @{ $pattrs->{$row->{attrcode}} }, [
            $row->{attrval},
            defined $row->{avdescription} ? $row->{avdescription} : $row->{attrval},
        ];

This patch fixes the code and removes commented line.
Also reviews the SQL query :
  - avcategory is useless
  - use alias attrcode for borrower_attributes.code to be more explicit

Test plan :
1) Create a patron A with overdues
2) Go to Circulation > Overdues
3) Check you see the patron A
4) Create a patron attribute, searchable, with an authorized value
   category, ie LANG
5) Edit patron A to set a value in this attribute
6) Go to Circulation > Overdues
7) Select attribute value and apply filter
8) Check you see the patron A
9) Redo test plan with a patron attribute, searchable, without an
   authorized value category

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-05-18 17:22:09 -10:00
..
add_message.pl
article-request-slip.pl Bug 29771: Scalar context for split 2022-03-08 23:03:34 -10:00
article-requests.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
bookcount.pl
branchoverdues.pl
branchtransfers.pl
checkout-notes.pl Bug 29380: Correct table name in joins to prevent errors 2021-11-03 15:40:52 +01:00
circulation-home.pl
circulation.pl Bug 30291: Changes to staff client files 2022-05-05 11:17:36 -10:00
del_message.pl Bug 29903: Prevent messages to be deleted from unauthorised users 2022-02-02 21:05:29 -10:00
hold-transfer-slip.pl
offline-mf.pl
offline.pl
on-site_checkouts.pl
overdue.pl Bug 30735: Fix filtering by patron attribute with AV in overdues report 2022-05-18 17:22:09 -10:00
pendingreserves.pl Bug 29609: Centralized code to build the link to a biblio detail page 2022-04-08 15:49:16 +02:00
renew.pl Bug 30167: (follow-up) Return a hash with soonest_renew_date 2022-05-04 14:29:23 -10:00
request-article.pl Bug 30094: Make the patron search from request-article.pl use the REST API 2022-04-04 09:47:00 +02:00
reserveratios.pl
returns.pl Bug 30291: Changes to staff client files 2022-05-05 11:17:36 -10:00
set-library.pl
transfer-slip.pl
transfers_to_send.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
transferstoreceive.pl Bug 19532: (RM follow-up) More use of system preference 2022-03-14 23:11:12 -10:00
view_holdsqueue.pl Bug 29015: Add options for itemtype, collection, and shelving location to view_holdsqueue.pl 2021-11-03 15:40:52 +01:00
waitingreserves.pl Bug 29771: Scalar context for split 2022-03-08 23:03:34 -10:00
ysearch.pl Bug 30251: (bug 10902 follow-up) With IndependentBranches non-superlibrarians do not get autocomplete list in circulation module 2022-03-25 11:01:04 -10:00