Hi everyone I need help with an annoying bug from a conflict of 2 modules: Addressfield and Ajax Login/Register
On my registration form, I have added an address field. The submission of the form is done in ajax via the module Ajax Login/Register

My bug is that if the user change country to any value, after that the validation callback doesn't display right away the Drupal error messages. Only after a page refresh. And same thing after successful registration, no Drupal message displayed.
If the country is not changed, the Drupal messages are working as expected.

I think what's happening is that Addressfield is changing the wrapper id of the form after changing country, but ajax/register is expecting another one.
Not sure howto fix my issue

Comments

heyyo created an issue. See original summary.

heyyo’s picture

Project: Address Field » Ajax Login/Register
Version: 7.x-1.x-dev » 7.x-4.x-dev

Not sure what's the best way to fix this issue.
For the moment instead of relying on drupal_html_id to generate the wrapper, I'm setting this directly to the form id:
ajax-register-user-register-form-wrapper

In function

 _ajax_register_add_ajax(&$form, $type)

  // Add ajax wrapper to form.
  if($type != 'user_register_form') {
    $html_id = drupal_html_id('ajax-register-' . str_replace('_', '-', $type) . '-wrapper');
  }
  else {
    $html_id = 'ajax-register-user-register-form-wrapper';
  }

I suppose this is enough, we won't have to 2 register forms on the same page.

heyyo’s picture

Title: Conflict with module Ajax login/register » Conflict with module Addressfield