Bug 29356 - Search for pickup library when placing a hold should be truncated in both directions
Summary: Search for pickup library when placing a hold should be truncated in both dir...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 29355
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-28 18:21 UTC by Andrew Fuerste-Henry
Modified: 2021-11-05 15:51 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.11.00


Attachments
Bug 29356: Pickup location dropdowns should perform 'contains' searches (3.82 KB, patch)
2021-10-28 18:37 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29356: Pickup location dropdowns should perform 'contains' searches (3.89 KB, patch)
2021-10-28 18:53 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29356: Pickup location dropdowns should perform 'contains' searches (3.95 KB, patch)
2021-11-01 17:29 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2021-10-28 18:21:03 UTC
When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville.

On the Libraries page in Admin, however, the search box both left- and right-truncates, so one can type "en" and find Centerville.

The search when placing a hold should truncate as the Libraries search does.
Comment 1 Tomás Cohen Arazi 2021-10-28 18:24:17 UTC
The datatables wrapper (which branches.pl uses) is configured to default to the 'contains' behavior.

We can do something similar with thise dropdowns.
Comment 2 Tomás Cohen Arazi 2021-10-28 18:37:17 UTC
Created attachment 127076 [details] [review]
Bug 29356: Pickup location dropdowns should perform 'contains' searches

When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville.

On the Libraries page in Admin, however, the search box both left- and
right-truncates, so one can type "en" and find Centerville.

This patch makes the search perform 'contains' searches.

To test:
1. Try placing a hold. Make sure your rules allow Centerville to be a
   valid pickup location.
2. Search 'cen'
=> SUCCESS: Centerville shows
3. Search 'en
=> FAIL: Centerville doesn't show
4. Apply this patch and reload
5. Repeat 2
=> SUCCESS: Works!
6. Repeat 3
=> SUCCSS: Centerville shows!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Andrew Fuerste-Henry 2021-10-28 18:53:14 UTC
Created attachment 127077 [details] [review]
Bug 29356: Pickup location dropdowns should perform 'contains' searches

When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville.

On the Libraries page in Admin, however, the search box both left- and
right-truncates, so one can type "en" and find Centerville.

This patch makes the search perform 'contains' searches.

To test:
1. Try placing a hold. Make sure your rules allow Centerville to be a
   valid pickup location.
2. Search 'cen'
=> SUCCESS: Centerville shows
3. Search 'en
=> FAIL: Centerville doesn't show
4. Apply this patch and reload
5. Repeat 2
=> SUCCESS: Works!
6. Repeat 3
=> SUCCSS: Centerville shows!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 4 Martin Renvoize 2021-11-01 17:29:35 UTC
Created attachment 127188 [details] [review]
Bug 29356: Pickup location dropdowns should perform 'contains' searches

When placing a hold, the dropdowns for selecting a pickup library automatically right-truncate, so one can type "cen" and find Centerville.

On the Libraries page in Admin, however, the search box both left- and
right-truncates, so one can type "en" and find Centerville.

This patch makes the search perform 'contains' searches.

To test:
1. Try placing a hold. Make sure your rules allow Centerville to be a
   valid pickup location.
2. Search 'cen'
=> SUCCESS: Centerville shows
3. Search 'en
=> FAIL: Centerville doesn't show
4. Apply this patch and reload
5. Repeat 2
=> SUCCESS: Works!
6. Repeat 3
=> SUCCSS: Centerville shows!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2021-11-01 17:30:21 UTC
Must admit, I find this a little weird and prefer 'starts-with'.. but, consistency is good.

Works as described, Passing QA
Comment 6 Jonathan Druart 2021-11-02 15:54:49 UTC
Pushed to master for 21.11, thanks to everybody involved!