Summary: | Item search shareable link adding selections for similar LOC auth values | ||
---|---|---|---|
Product: | Koha | Reporter: | Heather Rommens <heather> |
Component: | Searching | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | anneli.osterman, blawlor, carthur, laura, lisette, nick, rcoert, sbcornell |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40651 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 14322 | ||
Bug Blocks: | |||
Attachments: |
Bug 39072: Only select exact matches when populating search terms
Bug 39072: Only select exact matches when populating search terms |
Description
Heather Rommens
2025-02-09 22:24:51 UTC
Adding a comment to mention that this issue appears to be very similar to the bug reported in Comment 18 on Bug 14322 - Add option to create a shareable link for item searches. We're having the same problem with this feature. The link to a search for for PYBWF will return items with PYBWF and those with location PY. The link to a search for PYMG will return items with location codes PYMG, PYM, and PY. All of our location codes are built on this structure so the link feature won't be useful to us until the search is exact. Created attachment 185393 [details] [review] Bug 39072: Only select exact matches when populating search terms This patch simply reduces our matching pattern to ensure the string is an exact match, rather than partial To test: - Create LOC authorized values of ADULT with description "Adult" and ADULTG with description "Adult - Grab and Go" - Find a record with items and set one item to shelving location "Adult" - Find a second record with items and set one item to shelving location "Adult - Grab and Go" - Create an Item Search for Shelving location and select 'Adult' only - Search and get one result from the record selected above - Click Copy shareable link and paste/go in new tab - See that the results now include both records from above - Click Edit search button and notice that the Shelving location 'Adult - Grab and Go' was added to the selected criteria for the search - Apply patch - Repeat original search for 'Adult' location - Click 'Copy shareable link' - Open in new tab and confirm correct results - Repeat with a search for 'Adult - Grab and Go' and confirm shareable link gets the correct results I tested this in a several sandboxes but I could not replicate the original problem. The shared link worked correctly. Created attachment 185599 [details] [review] Bug 39072: Only select exact matches when populating search terms This patch simply reduces our matching pattern to ensure the string is an exact match, rather than partial To test: - Create LOC authorized values of ADULT with description "Adult" and ADULTG with description "Adult - Grab and Go" - Find a record with items and set one item to shelving location "Adult" - Find a second record with items and set one item to shelving location "Adult - Grab and Go" - Create an Item Search for Shelving location and select 'Adult' only - Search and get one result from the record selected above - Click Copy shareable link and paste/go in new tab - See that the results now include both records from above - Click Edit search button and notice that the Shelving location 'Adult - Grab and Go' was added to the selected criteria for the search - Apply patch - Repeat original search for 'Adult' location - Click 'Copy shareable link' - Open in new tab and confirm correct results - Repeat with a search for 'Adult - Grab and Go' and confirm shareable link gets the correct results Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> This works and makes sense that the grep function should have a regular expression with an exact matching start and end. When testing I found that the test plan was slightly off, so it could be confusing to replicate. Copying the link for the Adult grab and go link and pasting it actually returns the results for selecting both Adult and Adult grab and go. To test: Create LOC authorized values of ADULT with description "Adult" and ADULTG with description "Adult - Grab and Go" - Find a record with items and set one item to shelving location "Adult" - Find a second record with items and set one item to shelving location "Adult - Grab and Go" *This step should be for Adult grab and go: - Create an Item Search for Shelving location and select 'Adult grab and go' only - Search and get one result from the record selected above - Click Copy shareable link and paste/go in new tab - See that the results now include both records from above *This step you should see the Adult shelving location was added when it shouldn't be: - Click Edit search button and notice that the Shelving location 'Adult' was added to the selected criteria for the search It's counterintuitive that the param that's longer actually selects the option that's shorter, but what's happening is it takes the url query param value for location, ADULTG and greps for the values of the options, so both option values ADULT and ADULTG match. That's why it's selecting both options when you paste the link for the longer param ADULTG. I would be happy to switch my sign off to QA if someone else signs off. |