I have some forms created with the Drupal 7 core poll-module.
On these forms the captcha placement is beneath the vote button instead of above, see picture.

I hope you can help me to fix this.

Erik

CommentFileSizeAuthor
captcha.png22.05 KBeverkuil
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AlexandrShalbetskiy’s picture

Status: Active » Needs review

Hi, Erik.

In your theme template.php add new preprocess function.

function THEME_NAME_preprocess_poll_vote(&$variables) {
  $form = $variables['form'];
  $variables['choice'] = drupal_render($form['choice']);
  $variables['title'] = check_plain($form['#node']->title);
  $variables['vote'] = drupal_render($form['captcha']);
  $variables['vote'] .= drupal_render($form['vote']);
  $variables['rest'] = drupal_render_children($form);
  $variables['block'] = $form['#block'];
  if ($variables['block']) {
    $variables['theme_hook_suggestions'][] = 'poll_vote__block';
  }
}

Because poll module, render all children after submit button.

everkuil’s picture

Dear Alexander,

Your answer did the tric, thanks a lot.

Erik

soxofaan’s picture

Category: bug » support
Status: Needs review » Active
Chris Matthews’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (works as designed)

I'm closing this 6 year old support request as works as designed.