Repository navigation
fix: use the last tag when the search value starts with a comma - #4892
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@arpitjain099 Thank you very much! A PR against 4.1 would be cool as well! |
Summary
TagController::search()keeps the last comma-separated segment of the search value, so the admin tag autocomplete queries the tag being typed and not the whole field. The guard isif (strpos($autoCompleteValue, needle: ',')), which returns0when the value starts with a comma, so the split is skipped: a field reading, barreachesTags::getAllTags()intact, the query becomestagging_name LIKE ', bar%', and no suggestions come back.Same shape as #4883. This switches to
str_contains()and adds a, Barcase beside the existingfoo, Barone, which only covers a comma away from index 0.The
4.1branch has the same line, writtenstrpos((string) $autoCompleteValue, ','), so please let me know if a backport there would help.Checklist
composer checkpasses (format, lint, static analysis)composer testpasses (9766 tests, 3 redis tests skipped, no redis extension here).pnpm testnot run, no JS/TS changespnpm tscandpnpm oxlintpass for TypeScript changes - n/aphpMyFAQ\Setup\Update- n/aCHANGELOG.mdis updated for user-facing changes - n/a, a bug fix rather than a user-visible featureSummary by CodeRabbit