[Bug 19967] New: Search patrons with non-Latin languages is brocken if DefaultPatronSearchFields includes dateofbirth

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 19967] New: Search patrons with non-Latin languages is brocken if DefaultPatronSearchFields includes dateofbirth

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19967

            Bug ID: 19967
           Summary: Search patrons with non-Latin languages is brocken if
                    DefaultPatronSearchFields includes dateofbirth
 Change sponsored?: ---
           Product: Koha
           Version: 16.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Patrons
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]
                CC: [hidden email], [hidden email]

In this particular case you get the mysql error message:

Illegal mix of collations for operation 'like'

You can prevent this error by removing dateofbirth from
DefaultPatronSearchFields or by the following patch:

diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm
index 2446703..ba32a12 100644
--- a/C4/Utils/DataTables/Members.pm
+++ b/C4/Utils/DataTables/Members.pm
@@ -117,7 +117,12 @@ sub search {

         my @where_strs_or;
         for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} )
{
-            push @where_strs_or, "borrowers." .
$dbh->quote_identifier($searchfield) . " LIKE ?";
+            if ( $searchfield eq 'dateofbirth' ) {
+                push @where_strs_or, "DATE_FORMAT(borrowers." .
$dbh->quote_identifier($searchfield) . ", '%Y-%m-%d') LIKE ?";
+            } else {
+                push @where_strs_or, "borrowers." .
$dbh->quote_identifier($searchfield) . " LIKE ?";
+            }
+
             push @where_args, $term;
         }

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 19967] Search patrons with non-Latin languages is broken if DefaultPatronSearchFields includes dateofbirth

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19967

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
            Summary|Search patrons with         |Search patrons with
                   |non-Latin languages is      |non-Latin languages is
                   |brocken if                  |broken if
                   |DefaultPatronSearchFields   |DefaultPatronSearchFields
                   |includes dateofbirth        |includes dateofbirth

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 19967] Search patrons with non-Latin languages is broken if DefaultPatronSearchFields includes dateofbirth

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19967

--- Comment #1 from Katrin Fischer <[hidden email]> ---
I think we need to do the fix for all date fields, I just tried adding
datexpiry and it breaks the search as well. (dateexpiry, dateenrolled,
lastseen, updated_on..?)

To test:

- Configure DefaultPatronSearchFields including dateofbirth and surname
- Add a patron to your database with a cyrillig surname
- Try to search for the patron
- > keeps loading forever

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 19967] Search patrons with non-Latin languages is broken if DefaultPatronSearchFields includes dateofbirth

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19967

--- Comment #2 from Ulrich Kleiber <[hidden email]> ---
Created attachment 70490
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70490&action=edit
Bug 19967: Search patrons with non-Latin languages is brocken.

If DefaultPatronSearchFields includes a column with type
date, datetime or timestamp, search patrons with non-Latin
languages hangis on 'Processing...'.
Converting columns with type date, datetime or timestamp to
type string eliminates this bug.

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 19967] Search patrons with non-Latin languages is broken if DefaultPatronSearchFields includes dateofbirth

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19967

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]-c
                   |                            |ommunity.org

--- Comment #3 from Jonathan Druart <[hidden email]> ---
Ulrich, you are using a MySQLism, you should use Koha::Objects->columns
instead.

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 19967] Search patrons with non-Latin languages is broken if DefaultPatronSearchFields includes date or datetime field

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19967

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Search patrons with         |Search patrons with
                   |non-Latin languages is      |non-Latin languages is
                   |broken if                   |broken if
                   |DefaultPatronSearchFields   |DefaultPatronSearchFields
                   |includes dateofbirth        |includes date or datetime
                   |                            |field

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 19967] Search patrons with non-Latin languages is broken if DefaultPatronSearchFields includes date or datetime field

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19967

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 19967] Search patrons with non-Latin languages is broken if DefaultPatronSearchFields includes date or datetime field

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19967

--- Comment #4 from Ulrich Kleiber <[hidden email]> ---
Hi Jonathan, is it possible to get the data type of a column with
Koha::Objects->columns?

Katrin mentioned, that you could not reproduce the error under MariaDB. Our
MySQL Version is '14.14 Distrib 5.5.58, for debian-linux-gnu (x86_64)'. Perhaps
the implicit type conversion has changed in MariaDB.

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