LIMS-1003: Fix searching of container inspections #825
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA ticket: LIMS-1003
Summary:
If you go to the imaging admin page and (under inspections) type something in the search bar, you either get every container ever or an error 500.
The
paginate
function expects the last 2 values in$args
to be the start and end of the range required. The search code was adding to$args
after the start/end values had been added, so if you searched for a number, you just got every container ever, and if you searched for text you got an error about a "non-numeric value".Changes:
LOWER()
andCONCAT()
calls, and appending the search text to $args twice in one go.To test:
38893
. Only one result should appear, for proposal in38893.2151_thaum
. 14 results should appear, for proposal mx34066.