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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jweowu’s picture

Status: Active » Needs review
FileSize
4.33 KB
jweowu’s picture

A little additional DRY.

caspervoogt’s picture

I 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!

jweowu’s picture

Status: Needs work » Needs review
FileSize
4.17 KB

I'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.

Status: Needs review » Needs work

The last submitted patch, insert_at_front-1347906-4.patch, failed testing.

jweowu’s picture

I've re-rolled the patch for the current 7.x-2.x HEAD.

gnuget’s picture

I 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

Status: Needs review » Needs work

The last submitted patch, nodequeue-insert_at_front_6.x-2.x-1347906-7.patch, failed testing.

gnuget’s picture

Status: Needs work » Needs review

Seems to testbot test my patch against the 7.x-2.x branch but works fine into the 6.x-2.x version.

jweowu’s picture

If 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.

IT-Cru’s picture

Are they any plans to integrate this as a feature or have someone a patch against current 7.x-2.0-beta1?

gnuget’s picture

This is a very useful, i also would like to see that feature in new release

jweowu’s picture

If people could review the patch and get this to RTBC, it would doubtless help.

bibo’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

#6 works great with latest recommended (7.2-series) release. Please commit this.

  • fizk committed d204c2a on 7.x-2.x authored by gnuget
    Issue #1347906 by jweowu, gnuget: Add new optional feature to insert at...
fizk’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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