Coming form #1461670: Generalize to work with any Entity Type we noticed there is an implementation for hook_entity_query_alter() as a workaround for #1054168: EntityFieldQuery fails for entities that have no bundle for user entities.

The hook only checks the value, not the operator. As far as I can see, this is to fix the specific uses of the EnittyFieldQuery for xmlsitemap. In stead, we should fix the uses, in stead of (possibly wrongfully) altering the EntityFieldQuery.

This hook can potentially break uses of the EntityFieldQuery. For example:

$efq = new EntityFieldQuery();
$efq->entityCondition('entity_type', 'user', '<>');
$efq->entityCondition('bundle', 'a_bundle_that_exists_on_multiple_entity_types');

Granted, it is an edge case, but it still exists. I'll see if I can whip up a patch.

Comments

Jelle_S created an issue. See original summary.

jelle_s’s picture

Status: Active » Needs review
StatusFileSize
new3.54 KB
jelle_s’s picture

StatusFileSize
new3.47 KB

Had a continue; outside of a loop (copy paste error), changed it to a return;

jelle_s’s picture

StatusFileSize
new16.92 KB

That patch contained changes from the other issue... I need more sleep.

Aaaand... I've added this to the wrong issue

jelle_s’s picture

jelle_s’s picture

StatusFileSize
new3.47 KB

Just so the last patch is the correct one.