If $ids === FALSE, we load everything and don't bother to load from cache.

However, we still do cache sets on the loaded entities.

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new699 bytes

And here's the patch.

dave reid’s picture

Status: Needs review » Needs work

It seems we're missing some conditions that should be checked as well? Should we do a cache set if $conditions was used? Should we be looking at the $passed_ids variable instead because $ids is modified in line 83?

deviantintegral’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new697 bytes

Here's an update that checks empty($ids) instead. Otherwise, if previous loads caused some entities to be cached in the static cache, the above patch was still causing the set to run. I think we want to check $ids, because if it's populated that indicates that we had to hit the database.

As for $conditions, I think it's covered for us in the if before building the query.

josh waihi’s picture

skwashd’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#1670848: Unnecessary recaching of terms when using taxonomy_get_term_by_name

This is a duplicate of #1670848. I've just committed a patch from that issue.