In various ways :) Probably critical...
Example query:
<?php
$query = Drupal::entityQuery('node');
$query->condition('type', 'article'); // Doesn't change anything.
$query->condition('field_image.entity.filename', $filename);
debug($query->execute());
?>
There are a number of issues with the current code:
- It tries to create the entity without passing in the bundle, that explodes
- There's another place in the code where it just picks a random bundle, copied that for now.
- It still looks for 'entity keys', this has been renamed to entity_keys as part of the entity as plugins conversion.
- For nodes, it's additionally broken because it tries to work with the BC decorator.
Those things are fixed in the attached patch, but the main problem remains:
That nice comment about the the bundle not being relevant and just picking one is a lie. It matters very much, you need the right bundle to get the right fields on your $entity. Can't see an obvious way to get this information, maybe we have to look at which bundle has the field we're interested in and pick the first of those?
We sure have awesome test coverage for this ;)