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.
If you create a node type that uses attachments, and attach a file you get the remove/keep show/hide button replacement as expected. If you save the node without filling title (or some other form error) when the page reloads the replacement buttons do not appear.
This is caused by Drupal using the cached form to display the form and errors, and not going through hook_form_alter() which loads up the JS code. This happens with other Javascript as well - any module which loads JS files or CSS files in hook_form_alter() will fail to reload them if there's an error on a cached form.
Comments
Comment #1
adaddinsaneSorted by integrating with the Stylistics module, which is now a dependency.