User story: As a user, When using a "reverse" nodequeue (ie, items added at from of queue and popped off bottom), I wish to mark some nodes as sticky so that they do not change position when new nodes are added to the queue.

Attached is a patch to do this. It needs work and review; I couldn't figure out how to get the table to look right when the queue is empty. It also needs review. It "works for me," though.

I'm hoping this can be integrated into the module as this would be a very nice addition.

This is largely taken from the patch posted in #841850: Add stick to position functionality to nodequeue + some general improvements , but it has some changes/improvements from my end.

Comments

amateescu’s picture

I think this would be a nice feature, but there is a part that worries me in this patch:

+  if (count($nodes) != $subqueue->count) {
+    return 'Duplicate position values are not allowed. New subqueue order not saved.';
+  }

I'd prefer getting this in first: #593468: adding the same node more than once to a queue causes bad behavior, so we can actually support duplicate nids in a queue. It seems that more people want that behavior than.. sticky nodes for example :)

Also, please follow the Drupal coding standards when creating a patch for a contrib module. A lot of stuff is camelCased in your patch and that's not the Drupal way ;) Leaving as 'needs work'..

alexpetrov’s picture

Issue summary: View changes
StatusFileSize
new14.24 KB

Just in case anybody needs it, I created a version of this patch compatible with 7.x-2.x branch. I modified the code to be compatible with the branch plus did some minor modifications/optimizations.

danepowell’s picture

patch in #2 still doesn't match code standards, and has a devel function (dd) in the update hook.

ss81’s picture

StatusFileSize
new13.48 KB

Here is a new patch, which adds sticky rows functionality. Sticky rows don't change their positions when a user adds new content or clicks on Revers or Shuffle, but they still could be moved with drag-and-drop.

ss81’s picture

Status: Needs work » Needs review

The last submitted patch, d7sticky.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: nodequeue-sticky-rows-1351044-4.patch, failed testing.

ss81’s picture

Assigned: mrryanjohnston » ss81
ss81’s picture

StatusFileSize
new11.69 KB

New patch which was created based on 7.x-2.x branch

ss81’s picture

Status: Needs work » Needs review
ss81’s picture

It could be great if somebody can test the recent patch. Thanks!

jenlampton’s picture

Status: Needs review » Needs work

Patch does not apply cleanly to the latest 2.x-dev.

rajeevchoudhary’s picture

StatusFileSize
new0 bytes

I have fixed the issue, Created new patch

@jenlampton can you try attached patch