Skip to content

Added fix for filterable check in query - #35

Open
kevinmeijer97 wants to merge 2 commits into
masterfrom
feature/filterable-query-fix
Open

Added fix for filterable check in query#35
kevinmeijer97 wants to merge 2 commits into
masterfrom
feature/filterable-query-fix

Conversation

@kevinmeijer97

Copy link
Copy Markdown
Member

Updated ProductAttributeController to avoid calling the upstream filterable() scope when the project uses a different ProductAttribute model, falling back to the correct catalog_eav_attribute based filter.

$query = $model::with('attributeOptions');

// Pick the correct filter strategy for the configured model.
if (is_a($model, QueryBuilderProductAttribute::class, true)) {

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.

is_a can return true even when $model is an empty object, i think instanceof would be better here because that also checks if it really is a "object"

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.

2 participants