Skip to content
Snippets Groups Projects
Commit 83d6b95c authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#362256 by pwolanin: backport poll module vote number form access handling...

#362256 by pwolanin: backport poll module vote number form access handling from D7, avoid clearing vote numbers when editing a poll
parent 0a9453a0
No related merge requests found
......@@ -294,8 +294,6 @@ function poll_more_choices_submit($form, &$form_state) {
}
function _poll_choice_form($delta, $value = '', $votes = 0) {
$admin = user_access('administer nodes');
$form = array(
'#tree' => TRUE,
);
......@@ -308,17 +306,15 @@ function _poll_choice_form($delta, $value = '', $votes = 0) {
'#default_value' => $value,
'#parents' => array('choice', $delta, 'chtext'),
);
if ($admin) {
$form['chvotes'] = array(
'#type' => 'textfield',
'#title' => t('Votes for choice @n', array('@n' => ($delta + 1))),
'#default_value' => $votes,
'#size' => 5,
'#maxlength' => 7,
'#parents' => array('choice', $delta, 'chvotes'),
);
}
$form['chvotes'] = array(
'#type' => 'textfield',
'#title' => t('Votes for choice @n', array('@n' => ($delta + 1))),
'#default_value' => $votes,
'#size' => 5,
'#maxlength' => 7,
'#parents' => array('choice', $delta, 'chvotes'),
'#access' => user_access('administer nodes'),
);
return $form;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment