Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various changes to support refactoring CMS search filter functionality #11587

Draft
wants to merge 4 commits into
base: 6.0
Choose a base branch
from

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Jan 30, 2025

Important

There are a few commits here. Do not squash.

Commit 1: API Make SearchContext::individualFieldSearch() protected.
This is needed to allow a SiteTree-specific search context to add custom logic for a specific field, while falling back to this default logic for everything else.

Commit 2: API Provide minimum and maximum comparison values for numeric DBFields
This will be used with handling WithinRangeFilter in searchable fields so that if only one of the two ends of a range is filled in, the other can be automatically populated.

Commit 3: NEW Handle WithinRangeFilter in searchable_fields and SearchContext
This is especially helpful with date ranges, e.g. all records edited within a certain range, but can be used out of the box with basically any numeric, date, or time-based fields. This is required to support filtering against LastEdited for pages in the same way they currently do.

Commit 4: FIX Ensure composite fields have their values filled in the search form
In the CMS search filter, composite fields would always appear empty after submitting the form because their prefix was missing. This could also introduce conflicts if a same-named field was in the main edit form.

Issue

This is needed to allow a SiteTree-specific search context to add custom
logic for a specific field, while falling back to this default logic for
everything else.
This will be used with handling WithinRangeFilter in searchable fields
so that if only one of the two ends of a range is filled in, the other
can be automatically populated.
This is especially helpful with date ranges, e.g. all records edited
within a certain range, but can be used out of the box with basically
any numeric, date, or time-based fields.
In the CMS search filter, composite fields would always appear empty
after submitting the form because their prefix was missing. This could
also introduce conflicts if a same-named field was in the main edit
form.
@GuySartorelli GuySartorelli changed the title API Make SearchContext::individualFieldSearch() protected. Various changes to support refactoring CMS search filter functionality Jan 31, 2025
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.

1 participant