Skip to content

feat: added extension point to getIndexQuery - #58

Merged
tiller1010 merged 1 commit into
support/2.xfrom
hotfix/2.2.0/index-query-extension-point
Jun 4, 2026
Merged

feat: added extension point to getIndexQuery#58
tiller1010 merged 1 commit into
support/2.xfrom
hotfix/2.2.0/index-query-extension-point

Conversation

@tiller1010

@tiller1010 tiller1010 commented Jun 3, 2026

Copy link
Copy Markdown
Member

https://werkbotstudios.teamwork.com/app/tasks/39565673

Summary

added extension point to getIndexQuery. Allows index query to be added by dataextensions

Testing Steps

Issues/Concerns

  • If the base class defines getIndexQuery (like blog Articles in the case of flexcut), this won't be used. Feel free to double check this by extending articles.
  • We will likely want to carry this up to the main branch

Git Flow

  • DO NOT delete "release/*" or "hotfix/*" branches after merging a PR. These are used to publish the next release, and they are deleted automatically.
  • "Squash and merge" is good on "feature/*" into "develop"
  • "Create a merge commit" is good on "release/*" or "hotfix/*" into "main"

@tiller1010
tiller1010 requested a review from aletail June 3, 2026 18:45

@aletail aletail left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good - just see my one comment, I am probably overlooking something

{
return false;
$query = '';
$this->owner->extend('updateIndexQuery', $query);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not following why we have an extend here, if we overwrite this function (which is the intended route anyway right?) then why would we need the extend?

@tiller1010 tiller1010 Jun 4, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This allows a data extension to define the index query. This basically lets us add search functionality to any dataobject in the vendor directory.

Product::add_extension(SearchableExtension::class);
Product::add_extension(ProductExtension::class); // Defines the index query

Adding getIndexQuery to a data extension, after adding the searchable extension, would not work because it is defined in the searchable extension.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gotcha, that makes sense!

@tiller1010
tiller1010 requested a review from aletail June 4, 2026 15:20
{
return false;
$query = '';
$this->owner->extend('updateIndexQuery', $query);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Gotcha, that makes sense!

@tiller1010
tiller1010 merged commit 09139d3 into support/2.x Jun 4, 2026
3 checks passed
@github-actions
github-actions Bot deleted the hotfix/2.2.0/index-query-extension-point branch June 4, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants