calls to drupal_lookup_path('source', $path) will not cache negative results, resulting in the same database query potentially getting called several times on the same page view. This patch adds a cache for those negative results

CommentFileSizeAuthor
path-negative-source-cache.patch928 bytesWesley Tanaka

Comments

mfb’s picture

Status: Needs review » Needs work

Yes, it would be nice to avoid duplicate searches that previously returned false. But the proposed solution - introducing a new static variable - seems inefficient. Can't we find a way to reuse the existing $map variable? E.g., use $path as the key rather than the value, and set $map[$path] = FALSE. (Yes, we'd need to rework the code a bit.) (Mark and Nedjo)

Tobias Maier’s picture

Status: Needs work » Closed (duplicate)

i think the following issue fixes this as well:
http://drupal.org/node/65493

setting this to duplicate

Wesley Tanaka’s picture

Status: Closed (duplicate) » Fixed

I guess we're trying to describe a dependency relationship, rather than a duplicate? the issues are different. I've subscribed to
http://drupal.org/node/65493 and will follow that instead of this.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Wesley Tanaka’s picture

Version: x.y.z » 4.7.x-dev
Status: Closed (fixed) » Fixed

I discovered that this patch wasn't applying for me anymore. I looked at my path.inc (v 1.4.2.4) and it seems that this bug has been fixed, and thus can't be a duplicate of the still-open http://drupal.org/node/65493

Wesley Tanaka’s picture

Version: 4.7.x-dev » 5.x-dev

actually, i'm not sure that this is fixed in 4.7, but current HEAD has the logic of the original patch applied (albeit with different variable names).

see bug 103665

Anonymous’s picture

Status: Fixed » Closed (fixed)