If you go to http://ajax-register.drupalace.ru/ and click "Log in" without filling in any information, the block styling disappears.

This is because the wrapper ID used by the #ajax callback wraps both the block AND the form, not just the form.

Here is an attempt to place the wrapper between the block and the form, since #prefix and #suffix run after all theme wrappers.

Comments

spleshka’s picture

Re-rolled patch for the latest dev release. Also made minor changes. What do you think about it?

tim.plunkett’s picture

+++ b/ajax_register.moduleundefined
@@ -218,23 +230,9 @@ function ajax_register_form_alter(&$form, &$form_state, $form_id) {
-  $html_id = drupal_html_id('ajax-register-' . str_replace('_', '-', $type) . '-wrapper');
+  $html_id = 'ajax-register-' . str_replace('_', '-', $type) . '-wrapper';

+++ b/ajax_register.theme.incundefined
@@ -0,0 +1,14 @@
+  $html_id = 'ajax-register-' . str_replace('_', '-', $variables['form']['#form_id']) . '-wrapper';

Here you're reverting the addition of drupal_html_id(). If you add it back into the top function, you cannot use it in the bottom function. Perhaps the theme function should retrieve the correct ID from the submit button's ajax wrapper.

spleshka’s picture

You are right. New patch attached.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

spleshka’s picture

Status: Reviewed & tested by the community » Needs review

Thanks for your review and report! Commited to 7.x-4.x.

spleshka’s picture

Status: Needs review » Fixed

Change issue status

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.