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
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
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
#3
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
Thanks Ezra.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.