Currently if you call this function with the same arguments during the same request (quite likely if relation is being used a lot), then it will issue duplicate queries. Patch adds a static cache for this. I wanted to avoid keeping the fully loaded entities in $drupal_static, so instead this caches $entities (which is actually field_values rather than entities but I didn't rename that in this patch).

Had some trouble getting relation tests to run locally, so hoping the test bot will catch this one.

CommentFileSizeAuthor
relation.patch3.09 KBcatch

Comments

chx’s picture

Status: Needs review » Closed (fixed)