foreach error when drawing empty queue

ryan_courtnage - June 9, 2009 - 15:52
Project:Nodequeue
Version:6.x-2.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

<?php
print nodequeue_node_titles($subqueue_id);
?>

Doing this for a queue that is empty will result in a foreach error:

warning: Invalid argument supplied for foreach() in <path>/nodequeue.module on line 2517.

nodequeue_view_nodes() should either ensure that $nodes is an array, or nodequeue_load_nodes() should always return an array.

#1

ezra-g - June 14, 2009 - 01:14

Good point. would you like to submit a patch for this?

#2

TheOnlyHarry - July 23, 2009 - 09:38
Version:6.x-2.1» 6.x-2.3
Status:active» patch (to be ported)

Here you go...

AttachmentSize
nodequeue.module.patch 340 bytes

#3

ezra-g - August 26, 2009 - 19:28
Status:patch (to be ported)» needs review

Marking as needs review.

#4

ezra-g - August 27, 2009 - 16:46
Status:needs review» fixed

Committed to Drupal 5 and 6 branches.

Thanks!

#5

System Message - September 10, 2009 - 16:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.