Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 302514

Add an alter hook to EntityQuery

$
0
0

EntityFieldQuery in D7 had an alter hook. When we rewrote it for D8, we forgot to add an alter hook. The dead docs were removed in #2611638: hook_entity_query_alter() is dead, remove it from entity.api.php.

However, we definitely need it. It is currently a blocker for anyone looking to hardcode their own filtering behavior. Without hook_entity_query_alter() we need to alter the underlying SQL query, which is not trivial due to field storage (requires using Tables to add the joins, and copying the EntityQuery Condition logic for selecting a LEFT vs INNER join).

For examples of the difficulty in modifying entity queries using only the current hook_query_entity_reference() see block_content_query_entity_reference_alter() and the Query Access API (#777578: Add an entity query access API and deprecate hook_query_ENTITY_TYPE_access_alter()).

So, let's re-add the hook.


Viewing all articles
Browse latest Browse all 302514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>