Skip to content
New issue

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

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

Already on GitHub? # to your account

ID criteria on eager-loaded queries is ignored #2717

Closed
rungta opened this issue Apr 10, 2018 · 1 comment
Closed

ID criteria on eager-loaded queries is ignored #2717

rungta opened this issue Apr 10, 2018 · 1 comment

Comments

@rungta
Copy link

rungta commented Apr 10, 2018

Description

Eager-loaded elements support custom parameters such as authorId and kind. However, this does not appear to work for the id criteria.

Steps to reproduce

  1. Create an Entries field called related.
  2. Add some elements to an entry with this field.
  3. Query for this entry and try to eager-load the related field, like so:
craft.entries({
  section: 'news',
  with: [
    ['related', { id: 9999999 }]
  ]
})
  1. The related field on the entries returned should be empty arrays or contain only one element with the matching 9999999 id, if it had been added to the field. However, the related field arrays are returned unchanged.

Additional info

  • Craft version: 2.6.3015
  • PHP version: 5.5.38
  • Database driver & version: MySQL 5.7.17
  • Plugins & versions: None
brandonkelly added a commit that referenced this issue Apr 10, 2018
@brandonkelly
Copy link
Member

Fixed for the next Craft 2 and Craft 3 releases. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants