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

            Bug ID: 36025
           Summary: Extended attributes clause added to patron search
                    query even when there are no searchable attributes
 Change sponsored?: ---
           Product: Koha
           Version: 23.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Patrons
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]

In bug 34519 there is a commit labelled "ensure we always have an array":

-            [% SET extended_attribute_types = ExtendedAttributeTypes.codes(
staff_searchable => 1 ) %]
+            [% SET extended_attribute_types = [ ExtendedAttributeTypes.codes(
staff_searchable => 1 ) ] %]

Somehow this expands into an array containing the empty string as an element if
no attributes are searchable by default.

This is likely a bug in DBIx::Class.  It would be better to add the workaround
for this in the ExtendedAtributeTypes template plugin.

The get_column method of ResultSet returns values of type ResultSetColumn
according to the documentation.  But in reality it does not.  It returns an
array.

So we must rely on a bug already by using this method.  Consistently using it
in list context might be helpful as a workaround.

sub codes {
    my ( $self, $params ) = @_;

    my @codes =
Koha::Patron::Attribute::Types->search($params)->get_column('code');

    return \@codes;
}

The consequence is that a clause for extended attributes is added to the patron
search query.  This is significantly slower than not having such a clause, due
to some other issues with DBIx::Class.  (Se bug 33554 and bug 35361.)

-- 
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