If you look at node_load on api.drupal.org you see that caching is only used, when you parse $nid as parameter not as array('nid' => $nid).

Therefore here is a patch which solves this.

Comments

dawehner’s picture

dww’s picture

Status: Needs review » Needs work

Thanks for the report, but that's an empty patch.

dww’s picture

Title: Use node_load to allow caching. » Should invoke node_load() with only a $nid parameter to allow caching

(more accurate title)

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1.51 KB

Mh stange, here is the right patch

dww’s picture

Status: Needs review » Fixed

Looks great, thanks. I grepped to ensure those were the only spots that have this bug. Reviewed and committed to HEAD and DRUPAL-6--1. This will be out in RC5 (any day now).

Thanks again!
-Derek

dawehner’s picture

Shouldn't be there documentaion anywhere how to use node_load, perhaps also in the api docs for d5 and d6.

dww’s picture

@dereine: Sure. Feel free to open up a core documentation bug to patch the PHPDoc for node_load() to mention that using a numeric $param is the only way to get a cached copy of the node... I'd be happy to review/RTBC your patch if you add a link to it here. ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.