nodequeue_load_x functions should return data in a uniform format

martinjbaker - April 27, 2009 - 18:35
Project:Nodequeue
Version:6.x-2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi

I'm curious why nodequeue_load_front and nodequeue_load_back return an array of nodes rather than a single node as there can only be one node at the front or back. nodequeue_load_random_node does return a single node. It took me a while to work out why I wasn't getting the expected result but the random option worked fine.

thanks

Martin

#1

ezra-g - April 30, 2009 - 02:54
Title:Returning array rather than single node» nodequeue_load_x functions should return data in a uniform format
Category:support request» bug report

That's a good point -- I'd like to see them return the single node object, not inside a useless array. The fix should be pretty simple. Would you like to submit a patch?

#2

martinjbaker - May 4, 2009 - 19:14
Status:active» needs review

First time for everything...patch submitted. Wasn't that scary!

Changed:
nodequeue_load_front
nodequeue_load_back
nodequeue_view_random_node

all now return a single object rather than array for consistency with nodequeue_load_random_node

AttachmentSize
nodequeue-446452-2.patch 1.14 KB

#3

ezra-g - May 12, 2009 - 16:51
Status:needs review» fixed

Congratulations on your first patch. This is applied. I credited you in the commit message.

I'll highlight this change in the release notes so developers don't get thrown off.

Thanks!

#4

martinjbaker - May 12, 2009 - 22:03

Thanks Ezra.

#5

System Message - May 26, 2009 - 22:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.