I was going crazy because the Nodequeue wasn't displaying loading all nodes that I wanted it to load from the queue. After about three hours of debugging, I discovered that it was only loading the published nodes from the queue.

Filtering out the unpublished nodes should be handled by VIews, or something else. Here's a patch that hits up nodequeue_load_nodes and nodequeue_load_titles.

CommentFileSizeAuthor
unpublished.patch1.45 KBRobLoach
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobLoach’s picture

Status: Active » Needs review
merlinofchaos’s picture

You'd be surprised how many people were upset when this function *didn't* filter out unpublished nodes. I think I'm going to suggest that if you want unpublished nodes, you probably need to use a different way of getting at them. Probably use a view with embed?

RobLoach’s picture

Status: Needs review » Needs work

I guess that makes sense. What if we appended a $published parameter to the end as an option to filter out the unpublished nodes (defaults to TRUE)? This is where when I wish we had Drupal 7's awesome PDO stuff for conditional WHERE statements.

ezra-g’s picture

[edit - return the *unpublished* nodes by default]

We should have such a parameter and I would even lean towards making it return the unpublished nodes by default. There's no reason we should assume everyone is using Nodequeue for published nodes, since a queue for site admins could easily contain unpublished material. Also, Nodequeue is all about creating arbitrarily ordered groups of specific nodes, so it's not unreasonable to assume that people want all the nodes in the queue when they ask for nodes in the queue.

ezra-g’s picture

Status: Needs work » Fixed

I added a published_only parameter to these functions that defaults to FALSE, so that developers can choose which query they want. This is committed.

Thanks!

irakli’s picture

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.

I suspect it may be related to this change, because downgraded to the previous version of nodequeue, the problem is gone.

RobLoach’s picture

Status: Fixed » Active

What if we default $published_only to TRUE. So, by default it only shows published nodes. But if in the API you want to change that, you can.

ezra-g’s picture

That seems like a safer way of doing it. If you submit a patch, my next followup on this issue will be more timely than this one.

ezra-g’s picture

Status: Active » Fixed

Hmm, it seems like published_only already defaults to true. Marking as fixed.

Status: Fixed » Closed (fixed)

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