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

--- Comment #20 from Julian Maurice <[email protected]> ---
Comment on attachment 154331
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=154331
Bug 33554: [WIP] Add a new lookup endpoint for patron searching

Review of attachment 154331:
 --> 
(https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=33554&attachment=154331)
-----------------------------------------------------------------

::: Koha/Patrons.pm
@@ +93,5 @@
> +        }
> +        $attributes_rs = Koha::Patron::Attributes->search( { -and => 
> \@attributes_query } );
> +    }
> +
> +    push @{ $query->{-or} }, { 'me.borrowernumber' => { -in => [ 
> $attributes_rs->get_column('borrowernumber') ] } };

This will break if ExtendedPatronAttributes is disabled ($attributes_rs will be
undef)

Also, if no patron attributes are searchable,
`$attributes_rs->get_column('borrowernumber')` will return borrowernumbers of
all borrowers that have at least one attribute.

It's probably a good idea to use
`$attributes_rs->_resultset->get_column('borrowernumber')->as_query` instead in
order to not have to fetch all borrowernumbers first (not tested)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
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