Add to queue from Node edit form

greg.harvey - September 1, 2008 - 16:35
Project:Nodequeue
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Patch attached, please review. The purpose of this patch is to add a checkbox for each available queue to the bottom of the node/add and node/edit forms, so you can apply content to queues during the creation/update process.

Apologies for format of patch - see this post for an explanation. =(

AttachmentSize
nodequeue_module_node_edit_only.patch178.05 KB

#1

greg.harvey - September 1, 2008 - 19:30

Forgot to say, current patch is against 6.x-2.0-rc1 ... will be brought up to date when feedback is received.

#2

ezra-g - September 8, 2008 - 02:44
Status:needs review» needs work

This patch basically removes and replaces all of nodequeue.module in one giant hunk. I tried to apply it to nodequeue 6 rc1 as you specified, but got the message, "Reversed (or previously applied) patch detected!"

I'd like to give some feedback on the patch and am willing to review it even though it's not against a CVS checkout, but perhaps you could reroll so it:

a)applies
b) at least has discrete hunks?

Thanks.

#3

greg.harvey - September 8, 2008 - 09:54

Hi ezra-g - we are finally using Subversion, which can create CVS-style patches of the sort you require. It is one of our tasks for this sprint (which is only one week long) to re-roll these patches in a Drupal-friendly format. We will post them on this issue.

Thanks! =)

#4

tayzlor - September 18, 2008 - 16:43
Version:6.x-2.x-dev» 6.x-2.0-rc1

hey guys,
please find patch file attached.
includes functionality to allow you to add nodes to a nodequeue on the node/add form and add/delete nodes from a nodequeue on the node edit form.
code still needs a fair bit of work so open to suggestions / contributions :)

AttachmentSize
nodequeue_node_add_form_add_to_queue.patch 6.57 KB

#5

greg.harvey - September 30, 2008 - 09:36

Any news on this? Anyone able to review the patches? We're sort of on hold here. We want to re-roll them for dev, but not until we've had feedback, as there's little point in us re-rolling a patch the maintainers don't actually want.

#6

greg.harvey - September 30, 2008 - 09:37
Status:needs work» needs review

Oops, status change might help!

#7

ezra-g - October 24, 2008 - 17:23
Status:needs review» needs work

I think this would be a good addition. It should be configurable on a per-queue basis whether this form is added to the node edit form.

I'm unable to apply this patch, and manually adding this implementation of hook_form_alter causes a whitescreen error for me, with "Trying to get property of non-object in ...includes/theme.inc on line 220"

I would be happy to help with rolling these patches. I'm in IRC as ezra_ or contact me and we can figure out another way to communicate.

$ patch -p0 < nodequeue_node_add_form_add_to_queue.patch
(Stripping trailing CRs from patch.)
patching file nodequeue.module
Hunk #1 succeeded at 213 (offset -2 lines).
Hunk #2 FAILED at 284.
Hunk #3 FAILED at 339.
Hunk #4 succeeded at 744 (offset 49 lines).
Hunk #5 succeeded at 761 (offset 49 lines).
Hunk #6 succeeded at 2082 (offset 90 lines).
Hunk #7 succeeded at 2127 (offset 89 lines).
Hunk #8 succeeded at 2666 (offset 133 lines).
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 194:

#8

tayzlor - November 7, 2008 - 15:03

Hi ezra-g,
I was able to apply this patch to 6.x-2.0-rc1 , did you accidentally try and apply the patch to HEAD?

Thanks
G.

#9

merlinofchaos - November 7, 2008 - 17:03

Patches should only be submitted against -dev versions, never stable releases. Applying the patch to -rc1 doesn't do any good since there's no way to check it in.

#10

greg.harvey - November 9, 2008 - 10:18

To explain the patch:

We did it against -rc1 because we needed the functionality working for ourselves immediately on the most stable available version. We are aware it needs re-rolling against -dev before it can be checked in, but we do not want to do that if the feature won't be adopted, so we're asking for it to be checked first, to see if this will be something you want. If so, is the current implementation ok? If it is we will, or course, re-roll it against -dev.

If we re-roll it against -dev and you don't want it, then we wasted our time, so the -rc1 version is for you guys to check it as a feature add in principle and provide feedback on - then we can respond to your feedback and produce a proper patch against -dev you can commit. If we had created a patch against -dev in the first place, we would already have had to change it about four times prior to this post, just for review's sake, which would've been a waste of time! Patched against -rc1, we can tell you which specific version to use to *check* it and then tell us what we need to change before prorviding a patch on -dev. Hope that makes sense. =)

#11

ezra-g - January 9, 2009 - 19:23
Title:Work in progress, additional nodequeue checkboxes on node edit forms» Add to queue from Node edit form

Changing title for clarity

#12

Rob_Feature - January 9, 2009 - 19:45

This is just what I'm looking for but I'm not able to apply the patch...tells me it's malformed. Are others able to apply this (even against rc1)?

#13

tayzlor - January 14, 2009 - 13:26

what's the status of this patch?
do we need to re-roll against dev?

#14

ezra-g - January 14, 2009 - 16:10
Version:6.x-2.0-rc1» 6.x-2.x-dev

Yes, it would be easier to read and evaluate if you re-rolled it. In the meantime, some feedback on how it could be improved.

- It would be more efficient to use nodequeue_load_queues_by_type than loading all queues at every node edit form using $queues = nodequeue_load_queues(nodequeue_get_all_qids(NULL));

- To correctly implement hook_nodequeue_form_submit you should use nodequeue_nodequeue_form_submit instead of just nodequeue_form_submit

#15

tayzlor - January 15, 2009 - 16:18
Status:needs work» needs review

hi ezra,
thanks for the feedback,
i've now re-rolled patch against dev snapshot =)

thanks
Graham.

AttachmentSize
nodequeue_node_add_form.patch 3.52 KB

#16

ChrisBryant - March 18, 2009 - 06:40

I was just about to submit a feature request for this and luckily searched and found this issue first. This would be a great addition to the module!

#17

vaish - March 19, 2009 - 11:18

Patch re-rolled against HEAD, fixed and updated to conform to Drupal coding standards. Now it should be easy for ezra to review and evaluate.

I also tested the feature and it works fine for me.

AttachmentSize
nodequeue_node_add_form.patch 3.97 KB

#18

ezra-g - March 19, 2009 - 16:20
Status:needs review» needs work

Thanks for re-rolling this! I took a quick look at this, and as I said in #7, "I think this would be a good addition. It should be configurable on a per-queue basis whether this form is added to the node edit form." -- This is an important detail so as to prevent cluttering the node edit form for folks who don't want this feature. Also, I see some direct queries to the nodequeue tables and I'd encourage you to make sure there's not an API function available.

Thanks!

#19

wonder95 - April 30, 2009 - 03:42

I really could use this functionality, and I'd be willing to finish this up. I will work on adding the config options to allow the user to select whether the node is added automatically to the queue. As for API functions to replace direct calls to nodequeue tables, did you have anything specific in mind? This is my first foray into nodequeue, so I'm looking for API docs. Does this page look like it's accurate?

Thanks.

#20

attiks - May 26, 2009 - 15:19

I changed the code a bit, because my node was added to all subqueues.
Replace all 3 instances off

$subqueues = nodequeue_get_subqueues_by_node(array($queue), $node);      

with
//$subqueues = nodequeue_load_subqueues_by_queue($queue->qid);
$subqueues = nodequeue_get_subqueues_by_node(array($queue), $node);      

#21

attiks - July 1, 2009 - 07:39

Any change this will be included in the next version?

#22

greg.harvey - July 1, 2009 - 08:00

It could be but it's still marked as "needs work". Firstly, you'll need to apply the patch against HEAD, make your proposed changes, create a new patch and attach it here to include your changes.

Secondly, someone needs to write the functionality requested in #18 or this will stay as "needs work" forever. It is the maintainer's position that #18 is required before this will be considered, which is fair enough. So if you want this in Nodequeue and you have the time, it would be really cool if you could add #18 to the patch while you're at it. =)

(I don't have any time to look at this right now, sadly, or I would do it myself.)

#23

attiks - July 1, 2009 - 08:49

New patch including the option to show a certain queueu on the node edit form, feedback appreciated

Tested on my one of my sites, but with only the queues defined so needs more testing

AttachmentSize
nodequeue_302671.patch 5.33 KB

#24

ezra-g - October 5, 2009 - 13:48
Status:needs work» needs review

Marking as needs review since I didn't see that there was a patch here until just now.

#25

Liliplanet - October 14, 2009 - 16:03

subscribing, thx! would be wonderful if we can add the node to a certain queue directly from edit or submit form ..

#26

ezra-g - October 24, 2009 - 20:46
Status:needs review» needs work

Thanks for this patch! It looks like a good start but needs some work:

A) There is no access checking to make sure that the current user can manipulate the subqueues before they are added to the node edit form. See the nodequeue_api_queue_access and nodequeue_api_subqueue access functions

B) It seems like you're identifying the node form in an unconventional way. See an example from og.module or another module that alters the node edit form.

C) The first hunk fails and so the patch won't apply.

This seems like a good start though and I'd love to see this feature added. Thanks!

#27

greg.harvey - October 24, 2009 - 21:11
Assigned to:Anonymous» greg.harvey

Let me look at this next week. Doesn't sound like it needs much more work. =)

#28

tayzlor - November 25, 2009 - 11:57
Status:needs work» needs review

its been a while since i've been in this issue, but i've re-rolled this patch with the following -

- added collapsible fieldset to the node edit form for the list of queues
- fixed B) in #26, identifying the node form in a more conventional way (same as OG basically)
- fixed A) added nodequeue_api_queue_access check in the hook_form_alter to see if the current user has the ability to manipulate all queues

I haven't added a call to nodequeue_api_subqueue_access, is this neccessary?

hopefully the patch should apply.

AttachmentSize
nodequeue_add_to_queue.patch 4.71 KB

#29

tayzlor - November 25, 2009 - 12:04

some irregularity caused patch to fail locally when i tried to re-apply it again. Re-rolled again, tested locally, seems to apply, this one should work.

AttachmentSize
nodequeue_add_to_queue.patch 5.53 KB

#30

tayzlor - November 25, 2009 - 12:05
Assigned to:greg.harvey» Anonymous
 
 

Drupal is a registered trademark of Dries Buytaert.