Since default is 0, which means unlimited it shouldn't throw error:
"You've selected 1 items, but you're only allowed to select 0 items." So when i put it this way:

 if ($dropbox_limit !== 0) { // don't count if 0
  if (count($dropbox->lineages) > $dropbox_limit) {
    form_error($element, t("You've selected %select-count items, but you're only allowed to select %dropbox-limit items.", array('%select-count' => count($dropbox->lineages), '%dropbox-limit' => $dropbox_limit)));
  }
}

it works. Is there any problem with this?

Comments

wim leers’s picture

Title: Error when counting items » Dropbox limit set to zero not supported by server-side validation
Status: Needs review » Fixed

Ugh. I added this last minute and obviously didn't test thoroughly enough. Thanks for reporting!

Please post as a patch next time ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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