Heine

  • home
  • drupal
  • drupal core commits
  • about
Home › Forums › MyCaptcha › Bug reports

Handle position in forms better (Contact, CCK forms)

Benj — Sat, 02/06/2007 - 12:57

Hi,
on cck content add/edit forms, the mycaptcha field seems randomly placed: it can appear in the middle of the form instead of being at the very bottom.

It would be good if you could fix this so the catcha field would systematically be displayed at the bottom of cck add/edit forms.

Cordially,
Benj

No votes yet
‹ Mycaptcha and uieforum MyCaptcha not showing up ›
  • Bug reports

I'll see what I can do about it

Heine — Mon, 04/06/2007 - 21:26

Thanks Benj,

The very bottom would indeed be a preferable location. I'll see what I can do about it, but I can't promise it will be done before the next weekend.

Kind regards,

Heine

  • reply

patch for the mycaptcha form weight problem

Anonymous (not verified) — Thu, 02/08/2007 - 19:47

here's a patch for mycap.module which enables a "weight" option in the mycaptcha admin area.

@@ -137,6 +137,13 @@
         );
       }
     }
+
+    $form['captcha_weight'] = array(
+      '#title' => t('Captcha weight'),
+      '#type' => 'weight',
+      '#default_value' => variable_get('mycap_captcha_weight', '0'),
+    );
+
     $form['button']['save'] = array(
       '#type' => 'submit',
       '#value' => t('Save'),
@@ -158,6 +165,7 @@
  */
 function mycap_settings_form_submit($form_id, $form_values) {
   variable_set('mycap_captcha_type', $form_values['captcha_type']);
+  variable_set('mycap_captcha_weight', $form_values['captcha_weight']);
   $captcha_setting = $form_values['captcha_setting'];
   foreach ($captcha_setting as $rid => $settings) {
     foreach ($settings as $variable => $enabled) {
@@ -275,6 +283,8 @@
     $form['#validate']['mycap_validate_captcha'] = array();
     $form['#pre_render'][] = 'mycap_prerender_captcha';
     $form['#submit']['mycap_unset_captcha'] = array();
+
+    $form['captcha']['#weight'] = variable_get('mycap_captcha_weight', '0');
 
     // Prevent caching of this page.
     $GLOBALS['conf']['cache'] = FALSE;
@@ -680,4 +690,4 @@
     }
     $x += $char_width + mt_rand(-1, $max_delta_x);
   }
-}

  • reply

COmmit

Benj — Sun, 05/08/2007 - 11:08

Hi,
can this be commited to mycaptcha ?

I'm a bit disapointed that this module isn't updated more often.

Cordially,
Benj

  • reply

My spare time is

Heine — Sun, 05/08/2007 - 19:08

My spare time is limited.

The patch above is not a good solution IMO, because the weight the captcha should get depends on the form.

  • reply

Post new comment

I reserve the right to edit any comment submitted to the site. If your comment contains flaming, advertisements, or simply too many spelling errors (leet speak), it may never appear.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <as>, <as3>, <csharp>, <diff>, <drupal5>, <drupal6>, <html>, <js>, <mysql>, <php>, <phpbrief>, <python>, <sql>, <plain>, <xml>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

Recent posts

  • The Joomlafication of the Dutch-speaking community
  • Upgraded from 6.14 to 6.15, but Drupal still thinks it's 6.14?
  • Google Friendconnect Drupal module not recommended (yet)
  • The OpenID 2.0 Compliance Crusade - Part I
  • Using <embed> for XSS
more

Security reviews

  • Afraid custom code makes your site vulnerable?
  • You don't really trust that module you just downloaded from Drupal.org?

Sleep better after a security review.

Tags

Captcha CSRF DOH! Drupal embed Input Format modx OpenID Performance Planet Drupal Security Varnish
more tags
  • home
  • drupal
  • drupal core commits
  • about

Copyright © 2010 by Heine Deelstra. All rights reserved.