Download & Extend

Captcha placement on poll (drupal core) form

Project:CAPTCHA
Version:7.x-1.0-beta2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

AttachmentSizeStatusTest resultOperations
captcha.png22.05 KBIgnored: Check issue status.NoneNone

Comments

#1

Status:active» needs review

Hi, Erik.

In your theme template.php add new preprocess function.

<?php
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.

#2

Dear Alexander,

Your answer did the tric, thanks a lot.

Erik

#3

Category:bug report» support request
Status:needs review» active