When you make an ajax callback with #ajax in element form, if I reloaded form, compact form doesn't work anymore.
I think it's due to javascript based on #id of form. And when you reloaded form, the #id of form change.
I think if you got multiple same form on one page (so with different id) there are the same bug.

Other thing of review code (not same bug)
line 54


    $css_ids = explode("\n", variable_get('compact_forms_ids', 'user-login-form'));

mustt be


    $css_ids = explode(PHP_EOL, variable_get('compact_forms_ids', 'user-login-form'));

to work on every server

Comments

Musa.thomas’s picture

Here a trick to solve it :
In your ajax callback of your module

function mymodule_ajax_callback($form, $form_state) {
//Or drupal_get_form
 $new_form = drupal_build_form('your_form', $new_form_state);
  $css_ids = explode(PHP_EOL, variable_get('compact_forms_ids', 'user-login-form'));

  $css_ids = array_filter(array_map('trim', $css_ids));
//get the new css form ids.
  $css_ids [] = $new_form ['#id'];
  $settings ['compactForms'] ['forms'] = $css_ids;
//alter js settings.
  drupal_add_js($settings, 'setting');
}
Musa.thomas’s picture

Issue summary: View changes

add note

Musa.thomas’s picture

Project: Inline Form Errors » Compact Forms
Version: 7.x-2.0-alpha2 » 7.x-1.x-dev
Issue summary: View changes

wrong module

capellic’s picture

The ID has not changed in my case, see here for a patch: #2030969: Not working with ajax