Problem/Motivation

The nodequeue_subqueue_position function fails as it uses an old db_query method. Calling nodequeue_subqueue_position($sqid, $nid) results in Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given

Proposed resolution

Update the function with the new syntax

function nodequeue_subqueue_position($sqid, $nid) {	
  return db_query("SELECT position FROM {nodequeue_nodes} WHERE sqid = :sqid AND nid =:nid", array(
    ':sqid' => $sqid,
    ':nid' => $nid,
  ))->fetchField();
}

Comments

queenvictoria’s picture

StatusFileSize
new673 bytes

Patch attached

mrharolda’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

Marking it as RTBC!

Since this raises a "Recoverable fatal error", I'm also bumping the priority to 'Critical'.

Critical bugs either render a system unusable (not being able to create content or upgrade between versions, blocks not displaying, and the like), or expose security vulnerabilities. These bugs are to be fixed immediately.

seworthi’s picture

Works great.

amateescu’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Fixed

Commited a slightly modified patch to 7.x-2.x. Thanks for spotting this and for the patch :)

http://drupalcode.org/project/nodequeue.git/commitdiff/52e999d

Status: Fixed » Closed (fixed)

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