I can't seem to create a taxonomy queue without getting:

Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /home/dm7/sites/all/modules/contrib/nodequeue/smartqueue.module on line 70 and defined in db_query() (line 2220 of /home/dm7/includes/database/database.inc).

Comments

marcvangend’s picture

Priority: Normal » Critical

Having the same issue.
I'm also seeing the following error when I try to view the nodequeue, but I don't know it it's related:

Notice: Undefined offset: 5 in _menu_translate() (line 743 of /var/www/drupal/includes/menu.inc).

See also #676010: diff_menu() issue - undefined offset in includes/menu.inc on line 576 function _menu_translate().
When adding a node, I get:

    * Notice: Undefined property: stdClass::$taxonomy in smartqueue_taxonomy_nodequeue_subqueues() (line 87 of /var/www/karinwesselink/sites/all/modules/nodequeue/smartqueue.module).
    * Warning: Invalid argument supplied for foreach() in smartqueue_taxonomy_nodequeue_subqueues() (line 87 of /var/www/karinwesselink/sites/all/modules/nodequeue/smartqueue.module).
    * Notice: Undefined property: stdClass::$use_parents in smartqueue_taxonomy_nodequeue_subqueues() (line 105 of /var/www/karinwesselink/sites/all/modules/nodequeue/smartqueue.module).

It seems as if taxonomy smartqueues are completely broken (for me, at least) so I'm raising this to critical.

marcvangend’s picture

It seems as it the other error messages I pasted above, didn't have anything to do with the recoverable fatal error this topic is about. I found that some db queries were not changed for the new db layer yet. I was able to solve the error by editing function smartqueue_taxonomy_nodequeue_form_submit_finish() to this:

/**
 * Implementation of hook_nodequeue_form_submit_finish()
 */
function smartqueue_taxonomy_nodequeue_form_submit_finish($queue, $form_state) {
  $qid = db_query('SELECT qid FROM {smartqueue} WHERE qid = :qid', array(':qid' => $queue->qid))->fetchField();
  if ($qid) {
    db_query('UPDATE {smartqueue} SET use_parents = %d  WHERE qid = %d', $form_state['values']['use_parents'], $queue->qid);
  }
  else {
    db_query('INSERT INTO {smartqueue} (qid, use_parents) VALUES (:qid, :use_parents)', array(':qid' => $queue->qid, 'use_parents' => $form_state['values']['use_parents']));
  }
}

Sorry I can't roll a patch right now.

amateescu’s picture

Status: Active » Closed (duplicate)

@mgifford: You are getting this error because Smartqueue is not fully ported to D7. Marking as a duplicate of #983024: Port Smartqueue to D7 because that issue contains a patch.

mgifford’s picture

Makes sense to close this issue then.