The @search route drops all but the last value of a repeated parameter
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
Research direction
Start in packages/cmsui/routes/search.tsx and read how the @search route converts URL query parameters before making its search request. Reproduce the issue with two portal_type values in either order, then verify both values reach the request and results include both content types.
Written by the indexing model from the issue text.
Description
The @search route of @plone/cmsui (/@search/<path>) keeps only the last value of a repeated query parameter. A search for portal_type=Image&portal_type=News%20Item returns only news items, while Plone returns both types for the same query.
The route reads the query string in packages/cmsui/routes/search.tsx with:
const query = Object.fromEntries(new URL(request.url).searchParams.entries());
Object.fromEntries keeps one value per key, so each repeated value overwrites the previous one. Any multi-value filter (portal_type, review_state, Subject, UID…) silently loses values.
To Reproduce
Steps to reproduce the behavior:
- Have at least one Image and one News Item in the site.
- Log in to Aurora, so private items are included.
- Go to
http://localhost:3000/@search/?portal_type=Image&portal_type=News%20Item. - See that
itemsonly contains News Items. - Swap the order,
http://localhost:3000/@search/?portal_type=News%20Item&portal_type=Image, and see thatitemsonly contains Images.
Expected behavior
Items of both types, in both orders, as Plone returns for the same query at http://localhost:8080/Plone/++api++/@search?portal_type=Image&portal_type=News%20Item (Zope turns a repeated parameter into a list).
Software (please complete the following information):
- OS: Windows 11
- Browser: Chrome
- Plone Aurora Version:
mainat 210cf0039 (@plone/aurora1.0.0-alpha.22,@plone/cmsui1.0.0-alpha.15) - Plone Version: 6.2.2 (
plone/server-dev:6.2.2,make backend-docker-start) - Plone REST API Version: the one in
plone/server-dev:6.2.2
Additional context
No screen in core sends repeated parameters to this route today; I found it while building a block that lists items of several content types. It affects any add-on or future screen that filters @search by more than one value.
Related: #71 (the original search route task).
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 9
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 54
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plone/aurora
-
01 type: bug 41 lvl: easy
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yOpen01 type: bug 99 tag: UX Accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
01 type: bug 99 tag: UX Accessibility
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
Similar issues
-
accessibility bug dark-mode dashboards
Difficulty 1/5 Under an hour Newbie friendliness 84/100
quarto-dev/quarto-cli#15447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
521xueweihan/HelloGitHub#4655 ·
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount duePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
bug CRIT-3
Difficulty 1/5 Under an hour Newbie friendliness 70/100
NASA-AMMOS/anms#426 ·