Mmm, there is something I don't understand with node_cache.patch.

We set the cached node only if current user is an 'authenticated user', but we get this cached node unconditionnaly. So it means that everybody on the site get 'authenticated user' nodes, right ?

Does the following code change makes more sense ? We get the cached node only if current user is an 'authenticated user' too.

    if ($cachable) {
      if (isset($nodes[$param])) {
        return is_object($nodes[$param]) ? drupal_clone($nodes[$param]) : $nodes[$param];
      }
      if ($user->uid > 1 && count($user->roles) === 1 && in_array('authenticated user', $user->roles)) {
        $cache = cache_get($param, 'cache_node');
        if ($cache) {
          $cache = unserialize($cache->data);
          $nodes[$param] = is_object($cache) ? drupal_clone($cache) : $cache;
          return $nodes[$param];
        }
      }

Comments

robertdouglass’s picture

Assigned: Unassigned » robertdouglass

Good catch. I think this is a valid bug and have a hunch that similar code to the proposed was in an ancient version of the patch, and then got overlooked.

robertdouglass’s picture

Status: Active » Fixed

Fixed by applying the new base-2 integer cache key scheme to cache lookups as well as cache sets.

Anonymous’s picture

Status: Fixed » Closed (fixed)