Accession CO subview searches with multiple catalogNumbers only returns last number#8226
Conversation
Express search now splits on commas instead of splaces
Express search now splits on commas instead of spaces
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughIn ChangesExpress Search Term Parsing Fix
🚥 Pre-merge checks | ✅ 4 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@specifyweb/backend/express_search/search_terms.py`:
- Line 120: The search_str.split(',') call at line 120 preserves whitespace
around comma-separated terms, causing terms like ' cat2' (with leading space) to
be stored instead of 'cat2'. Since make_term only strips asterisks and not
whitespace, these spaces persist and cause create_text_filter to fail matching
against database values. Fix this by stripping whitespace from each term after
splitting and filtering out empty strings that result from consecutive or
trailing commas. Apply this fix to the split operation itself so that the terms
list contains clean, non-empty values before they are processed downstream.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2465ae6c-efe6-46ac-85bf-c598717f2cfb
📒 Files selected for processing (1)
specifyweb/backend/express_search/search_terms.py
emenslin
left a comment
There was a problem hiding this comment.
- enter a comma-separated list of catalog numbers and make sure that those numbers are all returned in the results box
- try adding spaces between the commas, both before and after to make sure those do not break the search box
- try adding non-conventional whitespace, like a tab to ensure that the search box does not break (you'll have to paste the tab in, here it is between the quotes " ")
Looks good, all results appear in the box with a comma-separated list!
Express search now splits on commas instead of spaces
Fixes #8221
Checklist
self-explanatory (or properly documented)
Testing instructions
Summary by CodeRabbit