Bug 16785 - Autocomplete broken on overdues report
Summary: Autocomplete broken on overdues report
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/circ/overdue.pl
Keywords:
: 28331 (view as bug list)
Depends on:
Blocks: 22956
  Show dependency treegraph
 
Reported: 2016-06-21 11:33 UTC by Owen Leonard
Modified: 2022-06-06 20:25 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.06


Attachments
Bug 16785: Remove Autocomplete from overdues report filter (12.38 KB, patch)
2021-05-14 13:49 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16785: Remove Autocomplete from overdues report filter (12.43 KB, patch)
2021-05-16 12:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 16785: Remove Autocomplete from overdues report filter (12.48 KB, patch)
2021-05-17 13:15 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 16785: [20.05] Remove Autocomplete from overdues report filter (12.34 KB, patch)
2021-05-25 16:03 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-06-21 11:33:35 UTC
If you have a patron attribute defined which is searchable and linked to an authorized value, that attribute will show up in the overdue report filter form as an autocomplete field.

The autocomplete is broken for cases where more than one result is returned by the search.
Comment 1 Katrin Fischer 2019-03-11 21:49:51 UTC
This appears to still be broken - even more than when reported. It appears now that the pull down with options never loads.
Comment 2 Katrin Fischer 2019-03-11 22:03:45 UTC
eferenceError: create_auto_completion_responder is not defined[Learn More] overdue.pl:486:1
Comment 3 Owen Leonard 2019-08-13 14:01:25 UTC
(In reply to Katrin Fischer from comment #2)
> eferenceError: create_auto_completion_responder is not defined[Learn More]
> overdue.pl:486:1

This aspect of it was caused by Bug 19700, but even after reverting that change the original problem still exists. I'm inclined to say this should not be an autocomplete field at all--it should be a regular dropdown. But the script is too much of a tangle for me to figure that out.
Comment 4 Katrin Fischer 2019-08-15 06:20:17 UTC
I'd agree, autocomplete doesn't match how we treat these fields elsewhere, so having a drop down would work better.
Comment 5 Owen Leonard 2021-05-14 13:49:27 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2021-05-14 14:30:42 UTC
*** Bug 28331 has been marked as a duplicate of this bug. ***
Comment 7 David Nind 2021-05-16 12:25:11 UTC Comment hidden (obsolete)
Comment 8 Martin Renvoize 2021-05-17 13:15:44 UTC
Created attachment 121043 [details] [review]
Bug 16785: Remove Autocomplete from overdues report filter

This patch removes code and markup related to an autocomplete input
field in the overdues report filter. The autocomplete was intended
to enable easy entry of patron attributes, but it's simpler to use a
Select2-styled <select>

The patch removes circ/ypattrodue-attr-search-authvalue.pl, which was
only used on this page and is now obsolete.

To test, apply the patch and create at least one patron attribute type
which is linked to an authorized value:

 - Administration -> Authorized values -> New category
   - Create a new category to test with
   - Add multiple authorized values under this category
 - Administration -> Patron attribute types -> New patron attribute
   type.
   - Create an attribute which is linked to the authorized value
     category you created AND which is marked "Searchable."
 - Go to Circulation -> Overdues.
   - In the sidebar filter you should see your patron attribute as an
     option, styled as a Select2 dropdown.
   - Clicking the dropdown should trigger a list of the authorized
     values you created above.
   - Test that the search field at the top of the list works correctly
     to filter the results.
   - Test that any repeatable attribute field can be cloned by clicking
     the "Add" link, and that cloned fields can be removed using the
     "Delete" links.
   - Test that cloned fields remain in place after submitting the fitler
     form, and that any selected entry in a Select2 widget is
     preselected.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2021-05-17 13:16:17 UTC
Nice one.. this works great now.

All works as expected, no QA script failures reported.

Passing QA
Comment 10 Jonathan Druart 2021-05-20 06:51:55 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 11 Fridolin Somers 2021-05-20 13:08:45 UTC
Pushed to 20.11.x for 20.11.06
Comment 12 Andrew Fuerste-Henry 2021-05-25 14:32:23 UTC
Doesn't apply cleanly to 20.05, please rebase if needed.
Comment 13 Owen Leonard 2021-05-25 16:03:13 UTC
Created attachment 121393 [details] [review]
Bug 16785: [20.05] Remove Autocomplete from overdues report filter

This patch removes code and markup related to an autocomplete input
field in the overdues report filter. The autocomplete was intended
to enable easy entry of patron attributes, but it's simpler to use a
Select2-styled <select>

The patch removes circ/ypattrodue-attr-search-authvalue.pl, which was
only used on this page and is now obsolete.

To test, apply the patch and create at least one patron attribute type
which is linked to an authorized value:

 - Administration -> Authorized values -> New category
   - Create a new category to test with
   - Add multiple authorized values under this category
 - Administration -> Patron attribute types -> New patron attribute
   type.
   - Create an attribute which is linked to the authorized value
     category you created AND which is marked "Searchable."
 - Go to Circulation -> Overdues.
   - In the sidebar filter you should see your patron attribute as an
     option, styled as a Select2 dropdown.
   - Clicking the dropdown should trigger a list of the authorized
     values you created above.
   - Test that the search field at the top of the list works correctly
     to filter the results.
   - Test that any repeatable attribute field can be cloned by clicking
     the "Add" link, and that cloned fields can be removed using the
     "Delete" links.
   - Test that cloned fields remain in place after submitting the fitler
     form, and that any selected entry in a Select2 widget is
     preselected.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Victor Grousset/tuxayo 2021-06-08 18:49:54 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.