Download & Extend

foreach error when drawing empty queue

Project:Nodequeue
Version:6.x-2.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

<?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.

Comments

#1

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

#2

Version:6.x-2.1» 6.x-2.3
Status:active» patch (to be ported)

Here you go...

AttachmentSizeStatusTest resultOperations
nodequeue-486438-1.patch340 bytesIgnored: Check issue status.NoneNone

#3

Status:patch (to be ported)» needs review

Marking as needs review.

#4

Status:needs review» fixed

Committed to Drupal 5 and 6 branches.

Thanks!

#5

Status:fixed» closed (fixed)

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