-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Criteria parameter isn't applied [Craft 4.4.9] #50
Comments
Interesting - this works as expected: {% set ids = entry.relatedTopics.ids() %}
{% set similarEntries = craft.similar.find({
element: entry,
context: ids,
criteria: {
limit : 1,
section: 'awards'
}
}) %} |
Hrm yeah not sure why that would be, but it sounds like we have a work-around? I'll close this up, but if you want to look into why it wouldn't work for a query but would for an object, feel free. It'd be interesting to see what's going on. |
Well that's the thing, I think you're doing the right thing here but it just doesn't seem to work anymore. Reasonably sure Similar was working with this pattern in earlier versions of Craft 4: craft-similar/src/services/Similar.php Line 78 in a8ce5c8
I'm happy with the workaround, but I guess this could cause issues for people upgrading. |
Yeah doesn't make sense to me. It's just converting it into an array. Maybe it contains some other properties that we causing an issue? In any event, I've re-opened it. Lmk if you find anything more |
Will re-open if additional information is provided |
Figured it out while looking into an unrelated issue. Fixed in the following releases: Craft 3: https://github.com/nystudio107/craft-similar/releases/tag/1.1.7 Craft 4: https://github.com/nystudio107/craft-similar/releases/tag/4.0.2 Craft 5: https://github.com/nystudio107/craft-similar/releases/tag/5.0.2 |
Describe the bug
criteria
doesn't seem to limit the resultset.To reproduce
Expected behaviour
criteria
should be used as the base element query that Similar extends.Versions
The text was updated successfully, but these errors were encountered: