Skip to content

Use munge_search_term from plone.base, fix multi-word wildcard#183

Merged
jensens merged 1 commit intomasterfrom
fix/4205-munge-search-term
Mar 29, 2026
Merged

Use munge_search_term from plone.base, fix multi-word wildcard#183
jensens merged 1 commit intomasterfrom
fix/4205-munge-search-term

Conversation

@jensens
Copy link
Copy Markdown
Member

@jensens jensens commented Mar 25, 2026

Summary

  • Replace local munge_search_term and helpers with import from plone.base.utils
  • Add zope.deferredimport deprecation shim for old import path (will be removed in Plone 7)
  • Fix multi-word search: all unquoted terms now get wildcard * suffix

Refs plone/Products.CMFPlone#4205

Depends on: plone/plone.base#117
Companion PR: plone/Products.CMFPlone#4305

Details

The munge_search_term function was a copy from Products.CMFPlone (introduced in 2.0.2 to break a circular dependency). Now that plone.base is the canonical location, this package imports from there. The QueryBuilder.munge_search_term(self, q) instance method wrapper is kept as a subclass hook.

The old import path plone.app.querystring.querybuilder.munge_search_term still works but emits a deprecation warning.

Test plan

  • Updated test_munge_search_term expectations for new wildcard behavior
  • Tests import from plone.base.utils (canonical location)
  • pre-commit passes

🤖 Generated with Claude Code

@mister-roboto
Copy link
Copy Markdown

@jensens thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@jensens jensens force-pushed the fix/4205-munge-search-term branch from 69d56f8 to 0fc475d Compare March 25, 2026 20:38
@jensens
Copy link
Copy Markdown
Member Author

jensens commented Mar 25, 2026

we are red here until plone/plone.base#117 is merged

Replace local munge_search_term and helpers with import from
plone.base.utils. Add zope.deferredimport deprecation shim for the
old import path (will be removed in Plone 7).

Update test expectations for the fixed wildcard behavior.

Refs plone/Products.CMFPlone#4205
@jensens
Copy link
Copy Markdown
Member Author

jensens commented Mar 27, 2026

Merge order is: plone.base first, then the other two PRs will pass GHA automatically.

@jensens jensens marked this pull request as ready for review March 27, 2026 09:49
@jensens jensens requested a review from petschki March 27, 2026 22:04
Copy link
Copy Markdown
Member

@petschki petschki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@jensens jensens merged commit 0b175ad into master Mar 29, 2026
13 of 17 checks passed
@jensens jensens deleted the fix/4205-munge-search-term branch March 29, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants