It would be great to have options for defining the minimum/maximum number of items to be selected before accepting a VBO submission.

…and it seems quite easy to achieve this, I'm rolling a patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Boobaa’s picture

Version: 7.x-3.0 » 7.x-3.x-dev
Status: Active » Needs review
FileSize
2.56 KB

Here it is, against latest 7.x-3.x branch.

Boobaa’s picture

Version: 7.x-3.x-dev » 7.x-3.0
FileSize
2.65 KB

Here is the same patch rolled against 7.x-3.0 for those poor souls (like me) who likes to stick with stable/supported releases as much as possible.

Boobaa’s picture

Version: 7.x-3.0 » 7.x-3.1
FileSize
2.56 KB

Rerolled the patch against 7.x-3.1.

bojanz’s picture

Status: Needs review » Needs work

Just repeating what I told you on IRC:

We want to do "force_single" with this as well. If the selection is limited, and maximum is 1, output radio buttons.
Also, if the selection is limited, hide "select all on all pages" and avoid batching.

Also, we want some kind of JS that tells you "You have selected X out of Y allowed items".

rvallejo’s picture

What about some rules integration, an action to set the min/max? I'm building a site right now that could use such functionality — depending on certain conditions, I'd want the maximum selections value to change, potentially infinitely so creating multiple views with different maximums set won't do. Maybe there are other ways it would make sense to integrate with Rules as well, but I haven't looked in depth at the existing integration to know off the top of my head.

Boobaa’s picture

Version: 7.x-3.1 » 7.x-3.2
Issue summary: View changes
FileSize
2.61 KB

Here's a reroll of #3 for 7.x-3.2, without any further changes (yet).

jungle’s picture

Version: 7.x-3.2 » 8.x-3.x-dev

As Drupal 8 is the mainstream nowadays, let's port this to Drupal 8

AaronBauman’s picture

Version: 8.x-3.x-dev » 4.2.x-dev