Needs work
Project:
Nodequeue
Version:
6.x-2.10
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Oct 2010 at 15:38 UTC
Updated:
29 Sep 2011 at 00:28 UTC
Jump to comment: Most recent file
Comments
Comment #1
jaydub commentedThis sounds like a reasonable request. The problem is that Nodequeue settings are all stored in a DB table {nodequeue_queue} so adding this feature and using the current settings paradigm for a queue would require adding a column to the nodequeue table as well as the standard Form API work and work on the autocomplete query to restrict by published status.
That being said, I think it's worthwhile and I will give it a try.
Comment #2
jaydub commentedOk I've put together a quick and dirty patch to get this up and running. Please review and maybe try on your site.
Comment #3
plousia commentedThanks so much for working on this. Unfortunately not working as expected. I check the "Limit to nodes that have published status" option and submit, but when I go back to the nodequeue settings page the option is not selected, and I'm still able to add unpublished nodes.
Also, I notice that this setting applies to the autocomplete field; it would be nice if on the nodequeue tab on an individual node the option to add to queue would be removed for unpublished nodes and, if set, the add/remove nodequeue links on each node wouldn't display on unpublished nodes. Not sure how much work this is, I definitely appreciate the time you've put into it. I'd love to be able to do this myself but unfortunately I'm not a coder.
Comment #4
jaydub commentedYou will need to run a module update in order to add a field to the nodequeue_queue table with this patch. Not sure if you did that...
The option to not show the add to queue on nodequeue tab on node pages, well then you'd have to check the unpublished/published option for all possible nodequeues since the setting is per nodequeue?
Comment #5
plousia commentedYup, ran update and everything. The other problem I forgot to mention is that this patch keeps the add nodequeue form from saving, so with it applied, it's not possible to create a new nodequeue at all.
Comment #6
luketsimmonsHey guys,
Had a look at this as it's rather useful to have. Normally we just modify our views to output published only and this is fine but the client requires the queue to filter when adding so the patch is perfect for what we need.
I've rerolled it (in the old skool method - I'm not git-ed up yet) so find attached.
It is working for 6.x-2.10 as I've been hidden away on a project and have just seen there is a 2.11 release out, so when I update to that I'll try making another patch if need be.
I think the issue plousia got was that the hook_update_n was for 6007 and I've moved it to 6008 (which might conflict with 2.11) and it added the field to the DB as expected.
Let me know what you think.
Thanks,
luke
Comment #8
jaydub commentedThere are two other ways that this can be done with both requiring custom code. The stock autocomplete query in nodequeue is passed through db_rewrite_sql() so in theory you can implement this hook and add the published constraint. Here is an example that we did for the same purposes on the CCK nodereference autocomplete in d6:
Furthermore in nodequeue.module in nodequeue_api_autocomplete() there does appear to be the ability to implement your own autocomplete callback per nodequeue:
So if a given nodequeue had owner of 'mymodule' then you should be able to implement an autocomplete callback: