Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
My use case requires that nodes are inserted at the front of the queue and removed from the back.
The existing 'Reverse in admin view' option can give the appearance that this is how the queue is functioning, but because the positions have not changed internally, I am unable to filter the nodes by position, because the positions of the "top" nodes are not consistent.
By providing an alternative option to insert at the front and remove from the back, the internal positions and the apparent positions match, and this kind of filtering is possible again.
Comment | File | Size | Author |
---|---|---|---|
#7 | nodequeue-insert_at_front_6.x-2.x-1347906-7.patch | 7.28 KB | gnuget |
#6 | insert_at_front-1347906-6.patch | 4.34 KB | jweowu |
#4 | insert_at_front-1347906-4.patch | 4.17 KB | jweowu |
#2 | insert_at_front-1347906-2.patch | 4.17 KB | jweowu |
#1 | insert_at_front-1347906.patch | 4.33 KB | jweowu |
Comments
Comment #1
jweowu CreditAttribution: jweowu commentedComment #2
jweowu CreditAttribution: jweowu commentedA little additional DRY.
Comment #3
caspervoogt CreditAttribution: caspervoogt commentedI tested this and it works well. I think it's a pretty important thing to include in Nodequeue. I know my users expect that when they add a node, it will show at the top by default, not at the bottom. The reverse admin view does cause confusion without this patch applied.
Thanks!
Comment #4
jweowu CreditAttribution: jweowu commentedI'm re-rolling this due to postgres support changes (glad to see COALESCE being used). The new patch applies against 2d396db1af4443fa4a8a9678bc17a6123e375948, but not the current HEAD
commit 9572de50a048c28fdff9e3d34a018a676f4ca338 also modifies nodequeue_subqueue_add(), and looks slightly wonky to me. Not broken, but moving the COALESCE into PHP is an strange/unnecessary change, which I think should be reverted.
That aside the patches seem pretty compatible -- they're both separating out the position calculation from the original query -- so I might roll another new patch against that, soon.
Comment #6
jweowu CreditAttribution: jweowu commentedI've re-rolled the patch for the current 7.x-2.x HEAD.
Comment #7
gnugetI needed this for drupal 6 so i've re-rolled the patch from #6 for the nodequeue dev version for drupal 6 (branch 6.x-2.x)
Patch attached.
Thanks @jweowu
Comment #9
gnugetSeems to testbot test my patch against the 7.x-2.x branch but works fine into the 6.x-2.x version.
Comment #10
jweowu CreditAttribution: jweowu commentedIf you give the patch a
-do-not-test.patch
suffix, the testbot will ignore it. You should do that when uploading a patch which applies to a different version than that of the issue itself.Comment #11
IT-CruAre they any plans to integrate this as a feature or have someone a patch against current 7.x-2.0-beta1?
Comment #12
gnugetThis is a very useful, i also would like to see that feature in new release
Comment #13
jweowu CreditAttribution: jweowu commentedIf people could review the patch and get this to RTBC, it would doubtless help.
Comment #14
bibo CreditAttribution: bibo commented#6 works great with latest recommended (7.2-series) release. Please commit this.
Comment #16
fizk CreditAttribution: fizk commentedCommitted. Thanks!