summaryrefslogtreecommitdiff
path: root/modules/poll/poll.module
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-01-11 23:26:00 -0500
committerwebchick <webchick@24967.no-reply.drupal.org>2012-01-11 23:26:00 -0500
commit371991597778094590ef37a87f4b57a65225797e (patch)
treeaef563f968a3ae2892e8cabea6ee0dc6b9c04b87 /modules/poll/poll.module
parent6f58aa16f0066d59c9e16a855ab1886d72f8d472 (diff)
downloadbrdo-371991597778094590ef37a87f4b57a65225797e.tar.gz
brdo-371991597778094590ef37a87f4b57a65225797e.tar.bz2
Issue #939880 by amateescu, marcingy: Fixed Poll Module throws PDOException when creating poll content.
Diffstat (limited to 'modules/poll/poll.module')
-rw-r--r--modules/poll/poll.module5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index aebb9f259..48001d099 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -408,6 +408,7 @@ function _poll_choice_form($key, $chid = NULL, $value = '', $votes = 0, $weight
'#maxlength' => 7,
'#parents' => array('choice', $key, 'chvotes'),
'#access' => user_access('administer nodes'),
+ '#element_validate' => array('element_validate_integer'),
);
$form['weight'] = array(
@@ -451,10 +452,8 @@ function poll_node_form_submit(&$form, &$form_state) {
*/
function poll_validate($node, $form) {
if (isset($node->title)) {
- // Check for at least two options and validate amount of votes:
+ // Check for at least two options and validate amount of votes.
$realchoices = 0;
- // Renumber fields
- $node->choice = array_values($node->choice);
foreach ($node->choice as $i => $choice) {
if ($choice['chtext'] != '') {
$realchoices++;