[Bug 18961] New: Datatable column filters of style 'select' should do an exact match
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Bug ID: 18961 Summary: Datatable column filters of style 'select' should do an exact match Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: veron@veron.ch QA Contact: testopia@bugs.koha-community.org Datatable column filters of type select do not do an exact match. E.g. for a select with values 'Fiction' and 'Non-fiction', filtering after 'Fiction' will match both. To reproduce: - Apply patch of Bug 16485 - Collection column in Item search is always empty - Make sure you have collection codes 'Fiction' and 'Non-fiction' - Do an item search - Filter column 'Collection', select 'Fiction' - Result: Column contains items of both collections (Fiction and Non-fiction) Similar problems can happen for other column filters of type select as well, see: jQuery DataTable ColumnFilter plugin. Can the “select” filter style support exact match? https://stackoverflow.com/questions/9520423/jquery-datatable-columnfilter-pl... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=16485 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 67883 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67883&action=edit Bug 18961: Use exact match for select filters on item search The SQL operator LIKE is always used for filters when searching for items. If the filter is a select, we should search for an exact match. That way we avoid problematic search like "%NFIC%" and "%FIC%" (one includes the other one). Test plan: - Make sure you have collection codes 'Fiction' and 'Non-fiction' - Do an item search - Filter column 'Collection', select 'Fiction' - Result: Column contains items from Fiction only -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67883|0 |1 is obsolete| | --- Comment #2 from Marc Véron <veron@veron.ch> --- Created attachment 67924 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67924&action=edit Bug 18961: Use exact match for select filters on item search The SQL operator LIKE is always used for filters when searching for items. If the filter is a select, we should search for an exact match. That way we avoid problematic search like "%NFIC%" and "%FIC%" (one includes the other one). Test plan: - Make sure you have collection codes 'Fiction' and 'Non-fiction' - Do an item search - Filter column 'Collection', select 'Fiction' - Result: Column contains items from Fiction only Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Patch complexity|--- |Trivial patch QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location notforloan ) ) { How do you know for sure that this comes from a select ? And that another value is not ? Note that we can choose to limit values by authorized values etc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #4 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- (In reply to Marcel de Rooy from comment #3)
if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location notforloan ) ) {
How do you know for sure that this comes from a select ? And that another value is not ? Note that we can choose to limit values by authorized values etc.
Indeed. We had this same problem. That is why I propose that all filters would be exact match in items search, SQL wildcard characters can be used to search like before : %text%. This is the way to search in items search form so I think it is logical. I will propose an alternate patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #5 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 68072 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68072&action=edit Bug 18961: (alternate) Datatable column filters use exact match by default Datatable column filters of type select do not do an exact match. E.g. for a select with values 'Fiction' and 'Non-fiction', filtering after 'Fiction' will match both. Similar problems can happen for other column filters of type select as well, see: jQuery DataTable ColumnFilter plugin. Can the 'select' filter style support exact match? https://stackoverflow.com/questions/9520423/jquery-datatable-columnfilter-pl... This patch removes the fact that search text in colum filter behaves as 'contains', match is exact by default so that filter with select are good. For text filters, one can always use whilcards characters like in items search form. Patch adds an hint text after search results. Test plan : - Apply patch of Bug 16485 - Collection column in Item search is always empty - Make sure you have collection codes 'Fiction' and 'Non-fiction' - Do an item search - Filter column 'Collection', select 'Fiction' - Result: Column contains items of both collections (Fiction and Non-fiction) - Choose a barcode from results, for example 123456 - Search on barcode with '3' of this barcode, you get no result - Search on barcode with '%3%', you get the barcode in results -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |In Discussion -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #3)
if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location notforloan ) ) {
How do you know for sure that this comes from a select ? And that another value is not ? Note that we can choose to limit values by authorized values etc.
It's the column headers: https://screenshots.firefox.com/NypKJESICLDt95Vi/pro.kohadev.org I am not sure I understand this concern. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not sure about making this change for the text input fields as well. The truncated search behaviour is often helpful there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #6)
(In reply to Marcel de Rooy from comment #3)
if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location notforloan ) ) {
How do you know for sure that this comes from a select ? And that another value is not ? Note that we can choose to limit values by authorized values etc.
It's the column headers: https://screenshots.firefox.com/NypKJESICLDt95Vi/pro.kohadev.org I am not sure I understand this concern.
No, this is about filters passed to SearchItems. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #7)
I am not sure about making this change for the text input fields as well. The truncated search behaviour is often helpful there.
I would agree. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I suggest to push my patch and assume that only these 5 columns are linked to a AV. It's not perfect but I do not think it worth the effort. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #11 from Marc Véron <veron@veron.ch> --- (In reply to Jonathan Druart from comment #10)
I suggest to push my patch and assume that only these 5 columns are linked to a AV. It's not perfect but I do not think it worth the effort.
+1 Marc -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68072|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Back to QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #13 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- (In reply to Jonathan Druart from comment #10)
I suggest to push my patch and assume that only these 5 columns are linked to a AV. It's not perfect but I do not think it worth the effort.
Ok, its better to have a fast solution than a long one. I'm keeping the idea in mind. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67924|0 |1 is obsolete| | --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 68258 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68258&action=edit Bug 18961: Use exact match for select filters on item search The SQL operator LIKE is always used for filters when searching for items. If the filter is a select, we should search for an exact match. That way we avoid problematic search like "%NFIC%" and "%FIC%" (one includes the other one). Test plan: - Make sure you have collection codes 'Fiction' and 'Non-fiction' - Do an item search - Filter column 'Collection', select 'Fiction' - Result: Column contains items from Fiction only Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Passing QA with reference to the discussion above. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18961 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org