Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Musa.thomasHere a trick to solve it :
In your ajax callback of your module
Comment #1.0
Musa.thomasadd note
Comment #2
Musa.thomaswrong module
Comment #3
capellicThe ID has not changed in my case, see here for a patch: #2030969: Not working with ajax