In the documentation for this function and for the Drupal 6 version of this module, passing in 0 for the first parameter returns all queues. However for the Drupal 7 version the module currently passes the $page_size variable directly into the select statement, so passing in 0 returns no values.

Comments

setvik’s picture

StatusFileSize
new1.45 KB

Tracked this down to how PagerDefault::limit and PagerDefault::execute work in DBTNG.

Limit's documentation implies setting $limit to 0 should just disable the pager and return all results; Execute's docs suggest the intended behavior is to kill the query and return no results.

Posted a doc issue here: http://drupal.org/node/1136576

In the meantime, the attached patch solves 2 problems:

1) it caches the query results based on $page_size
2) if $page_size is 0, it removes the PagerDefault call and returns all results as expected

amateescu’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new2.16 KB

I encountered this bug while working on #817558: Machine names in the nodequeue relationship handler, so we should really clean up this function.

@setvik, thanks a lot for investigating this. Attached patch follows your conclusion and solved problems from #1 and also updates it to make better use of the wonderful D7 database api.

amateescu’s picture

New patch that also uses the $pager_element parameter and fixes some calls to nodequeue_get_all_qids() from nodequeue.actions.inc.

Commited attached patches to 6.x and 7.x.

http://drupalcode.org/project/nodequeue.git/commit/00e7ff9
http://drupalcode.org/project/nodequeue.git/commit/b1245aa

Status: Fixed » Closed (fixed)

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