diff --git a/core/modules/poll/poll.module b/core/modules/poll/poll.module index dd5531e..c801579 100644 --- a/core/modules/poll/poll.module +++ b/core/modules/poll/poll.module @@ -389,6 +389,7 @@ function _poll_choice_form($key, $chid = NULL, $value = '', $votes = 0, $weight '#default_value' => $votes, '#size' => 5, '#maxlength' => 7, + '#min' => 0, '#parents' => array('choice', $key, 'chvotes'), '#access' => user_access('administer nodes'), ); @@ -440,9 +441,6 @@ function poll_validate($node, $form) { if ($choice['chtext'] != '') { $realchoices++; } - if (isset($choice['chvotes']) && $choice['chvotes'] < 0) { - form_set_error("choice][$i][chvotes", t('Negative values are not allowed.')); - } } if ($realchoices < 2) { diff --git a/core/modules/poll/poll.test b/core/modules/poll/poll.test index ace8d56..d6ed485 100644 --- a/core/modules/poll/poll.test +++ b/core/modules/poll/poll.test @@ -47,8 +47,8 @@ class PollWebTestCase extends DrupalWebTestCase { $edit['choice[new:1][chvotes]'] = -1; $edit['choice[new:0][chvotes]'] = $this->randomString(7); $this->drupalPost(NULL, $edit, t('Save')); - $this->assertText(t('Negative values are not allowed.')); - $this->assertText(t('Vote count for new choice must be an integer.')); + $this->assertText(t('Vote count for new choice must be higher or equal to 0.')); + $this->assertText(t('Vote count for new choice must be a number.')); // Repeat steps for initializing the state of the internal browser. $this->drupalLogin($web_user);