I would like to add a node to a nodequeue via my php module and I have the following code snippet:
$queue = nodequeue_load(3);
$subqueue = nodequeue_load_subqueues_by_queue($queue->qid);
nodequeue_subqueue_add($queue, &$subqueue, $nid);
When I try to run this, I get: warning: Attempt to increment/decrement property of non-object in nodequeue.module on line 2189.
Can anyone let me know the proper way to do this? Thanks in advance.
Comments
Comment #1
merlinofchaos commentedNote that nodequeue_load_subqueues_by_queue() is plural. It's loading an array of subqueues. You either need to get the sqid you want to load a particular subqueue, or use something like current() and get the first subqueue of the array.
Comment #2
arcane commentedThanks I was able to print out the value of $subqueue above and got: