Replace

$nodes = array();
foreach ($result as $nid) {
$nodes[] = node_load($nid->nid);
}

with node_load_multiple().
If many nodes are concerned, the request might take too long.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

olteanu5000’s picture

olteanu5000’s picture

Status: Active » Needs review
skipyT’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: 2207489-nodequeue_load_nodes-bug.patch, failed testing.

olteanu5000’s picture

FileSize
521 bytes
olteanu5000’s picture

Status: Needs work » Needs review
Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

works like a charm

  • fizk committed 466a80c on 7.x-2.x authored by olteanu5000
    Issue #2207489 by olteanu5000: Nodequeue_load_nodes inefficient
    
fizk’s picture

Category: Bug report » Feature request
Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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