I am using Drupal 7 with nodequeue, trying to generate a smartqueue for a vocabulary. When I set it up, I only get one "subqueue" for the entire vocab. I thought it was supposed to make a subqueue for each term in the vocabulary? Is this correct?

Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chrisschaub’s picture

The error is somewhere in this code in nodequeue_genereate.module, I think.

    // Rehash for each tid.
    $nids = array();
    foreach ($tids as $tid) {
      foreach ($fields as $field) {
        $query = db_select('field_data_' . $field, 'f')
          ->condition('f.entity_type', 'node')
          ->condition('f.bundle', $queue->types, 'IN')
          ->condition('f.deleted', FALSE)
          ->condition('f.' . $field . '_tid', $tid->tid)
          ->fields('f', array('entity_id'))
          ->range(0, 1)
          ->execute();
        $nids += $query->fetchAll();
      }

      foreach ($nids as $nid) {
        $node = node_load($nid->entity_id);
        nodequeue_api_subqueues($queue, $node);
      }
    }

I first thought it was the range(0,1) which only got 1 node, but now I'm not sure. It could also be the node_load is running out of memory. I have about 85 nodes that are classified by terms. That shouldn't be enought to run out of memory, and I'm not getting any error. It only processes the first term in the vocab, only that term gets a taxonomy smartqueue. Any pointers are greatly appreciated. No errors either, just the first term gets a queue. Weird.

chrisschaub’s picture

Status: Active » Needs review
FileSize
1.32 KB

Here's a patch that fixes the issues with taxonomy smartqueues not creating queues for each term. The issue has to do with how the array append happens. The array append behavour in PHP5 is a bit tricky and the nids are never getting appended so the term queues are not getting genereated. It just keeps the first node in the nids array. This patch is an attempt to fix it.

gazzer82’s picture

I also have this problem, however i am unable to apply the patch to the latest beta or dev build, i get an unexpected end of file.

Is this patch current for the latest builds?

Thanks

Gareth

chrisschaub’s picture

Yes, latest dev for drupal 7. Are you using git to apply patch?

gazzer82’s picture

No I'm using patch on the command line is OSX, i haven't ever used GIT.

Could you pint me in the direction of some instructions and i shall give it a go!

Thanks for your help.

Gareth

gazzer82’s picture

OK, just tried it with GIT and i get the a message telling me there is a corrupt patch at line 43.

Any ideas?

Thanks

Gareth

amateescu’s picture

Category: support » bug
Status: Needs review » Fixed

Confirmed the bug and the patch from #2 fixes it.

Commited to 7.x-2.x. Thanks!

http://drupalcode.org/project/nodequeue.git/commit/136e46f

Status: Fixed » Closed (fixed)

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