Status count change batch fails to process all result rows

mlsamuelson - November 3, 2009 - 22:02
Project:Signup Status
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

In signup_status_admin_signup_count_change_batch(), processing the query results with the following code fails to process all rows.

$query = db_query("SELECT nid FROM {signup_log} WHERE status IN ($placeholders) GROUP BY nid", $status_cids);
while ($nid = db_result($query)) {
  $context['sandbox']['nodes'][] = $nid;
}

I believe this is due to db_result() being best suited for pulling one result from a query.

#1

mlsamuelson - November 3, 2009 - 22:06
Status:active» needs review

Changing the code above to

$query = db_query("SELECT nid FROM {signup_log} WHERE status IN ($placeholders) GROUP BY nid", $status_cids);
while ($nid = db_fetch_object($query)) {
  $context['sandbox']['nodes'][] = $nid->nid;
}

resolves the issue and processes all result rows.

Patch attached.

AttachmentSize
signup_status-622488.patch 896 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.