drush_choice_multiple seems broken when $defaults is FALSE and $max is not set. The problem code seems to be here:

    // If the user selected too many options, drop the oldest selection.
    if (count($selections) > $max) {
      array_pop($selections);
    }

Should be:

    if (isset($max) && count($selections) > $max) {
      array_pop($selections);
    }

Otherwise, every selection the user makes then gets unset again in this code.

CommentFileSizeAuthor
#1 drush-1154132-drush_choice_multiple-1.patch842 bytesq0rban

Comments

q0rban’s picture

Status: Active » Needs review
StatusFileSize
new842 bytes
q0rban’s picture

Title: drush_choice_multiple() broken if $defaults is FALSE and $max is NULL » drush_choice_multiple() does not allow selecting if $max is NULL
kostajh’s picture

This works great, thanks for the patch!

moshe weitzman’s picture

Status: Needs review » Fixed

Committed to master and 4.x. Sorry this sat for so long. I just happenned upon it.

Status: Fixed » Closed (fixed)

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