Latest Build broke Nodequeue - can't add nodes
irakli - June 12, 2009 - 01:50
| Project: | Nodequeue |
| Version: | 6.x-2.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | duplicate |
Description
I am getting "Restricted Node - NID: 106" error, for no good reason, when trying to add a new node, with the latest release of nodequeue.
After downgrading to the previous release: the problem is gone!

#1
Could you explain where you are seeing this error and the steps to recreating it?
#2
When I try to add node to a queue from a queue view.
#3
There is an error in nodequeue.module in function nodequeue_ajax_add() where the data-element in the return array is populated by a call to function nodequeue_arrange_subqueue_entry(...). This function call is missing an argument telling the function which nids are visible. I've created a patch to fix this error.
#4
Thanks for taking the time to roll this patch!
It looks like you changed the query so that it doesn't specify the ASC/DESC order which is necessary for queues that are automatically reversed.
I'm marking this as a duplicate of #483204: Queue Manipulation callbacks not updated from Drupal 5 since it's clear that to fix both of these issues, we need to move the queries for getting restricted and unrestricted lists of nids into the same new helper functions for consistency.
#5
@psletten, taking closer look at your patch, it looks like it addresses a separate bug from not being able to add nodes. Can you clarify whether this is the case?
#6
@ezra-g, Sorry no. It addresses the bug about not being able to add nodes. It was impossible to add any nodes via the nodequeue_ajax_add() functionality, and I also got the error "Restricted Node - NID: XXX"
#7
I've removed the ASC/DESC from the SQL in function nodequeue_arrange_subqueue because it did not seem relevant to me. The result is used to create an array with nid as key. So there is really no need to have the database sort the results when the index created is not ordered in the same manner. As far as I can see it will only be relevant if nodequeues can have more than one entry with the same nid. But they can't, can they?
#8
Subscribing. If this patch doesn't get incorporated soon, I will have to roll back to a previous version of Nodequeue.
#9
I had the same issue and looked at the patch for 5.x. The array of restricted nids is an optional parameter to the nodequeue_arrange_subqueue_entry function, its defaulted to empty. I think if the array is empty, the assumption is that you do not want to restrict which nodes are displayed. The attached patch adds a test to the if statement that displays the title or the "Restricted Node" message.
#10
Did the upgrade to 2.2 require a database change via update.php? I can't recall, but if there was no database update required, then I will downgrade to 2.1 so I can work on my localhost site until the patch is integrated. If anyone remembers, please let me know. Thanks!
#11
fixed with SA-CONTRIB-2009-041.
#12
Please see http://drupal.org/node/512086
#13
Duplicate of #512086: Can't add nodes using autocomplete textbox, titles display as restricted when manipulating queue for own nodes . Please do not post to this issue.