Problem/Motivation

It would be great to have a simple way of sorting actions.

It has been already discussed in #1550092: Allow sorting and grouping of actions for 7.x.

Comments

plopesc created an issue. See original summary.

plopesc’s picture

Issue summary: View changes
plopesc’s picture

plopesc’s picture

Status: Active » Needs review
StatusFileSize
new5.56 KB
new45.13 KB

Attaching patch.

Here you can see a screenshot of the results:
VBO actions sorting

Thank you

graber’s picture

A hint here:
From what I remember, config structure allows both sorting actions and using same actions with different custom labels and different preliminary configuration so it's pretty powerful (just try editing view config yml manually and `drush cim`). It's the UI that is lacking implementation and I remember additional AJAX requests in the views modal were causing errors when I was working on this. Hopefully that's not an issue anymore.

Ohh, a patch already.. ok.

plopesc’s picture

Thank you for the hints!

Yeah, we only had to manage the sorting at storing the view time. Once the view is saved, all the things are working as expected!

Hope you find the patch useful

ivnish’s picture

Status: Needs review » Reviewed & tested by the community

Patch #4 works! Thanks!

graber’s picture

We'll need to separate the configuration logic from the Views field plugin class as it's growing too big and readability is getting worse. I'll get to that next thing when I'll have a bit break from the paid work. If anyone wishes to handle this earlier feel free to reassign.

ivnish’s picture

Patch works, but it adds item "weight" to views config and phpunit is warning about "incorrect schema"

graber’s picture

Status: Reviewed & tested by the community » Needs work

NW then.

hitesh-jain’s picture

StatusFileSize
new5.45 KB

Reroll the patch from https://www.drupal.org/project/views_bulk_operations/issues/3319079#comm... to apply against the 4.2.x branch.

mayaslatinek’s picture

Status: Needs work » Reviewed & tested by the community

The patch applies nicely and does the job.

graber’s picture

Status: Reviewed & tested by the community » Needs work

Please see #9 before marking this as RTBC again.

We don't need to store weight here at all, it's enough to reorder actions in view config.

Otherwise this is great work and it's very close, hopefully someone will fix the config issue sometime soon.

  • Graber committed a1afc575 on 4.2.x
    Issue #3319079 by plopesc, hitesh-jain, Graber, ivnish: Allow sorting of...
graber’s picture

Status: Needs work » Fixed

Fixed according to my last comment. No big deal and this'll not hang here forever ;) Thanks all!

Status: Fixed » Closed (fixed)

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