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.
Problem/Motivation
The $form_id class is in the form array, but the class does not make it into the form.
Note that adding any new classes also fail, so there is something going on after hook_form_alter() that nukes the classes for this form only.
See screenshot, the Devel output is from hook_form_alter() in my theme.
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
Screen Shot 2015-02-10 at 13.12.53.png | 340.02 KB | Jeff Burnz |
Comments
Comment #1
drubbLooks like this is a somehow strange, but intended behaviour: if a form inside a block has a class attribute, this class attribute is intentionally moved upwards to the block, and removed from the form. So now the block gets the class attribute:
From BlockViewBuilder.php:
So I think this issue can be closed.
Comment #12
quietone CreditAttribution: quietone at PreviousNext commented@Jeff Burnz, Thanks for the report.
@drubb answered in #1 that this is working as designed. Therefore changing status and version to the time of that comment.
Cheers