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.
Any attempt of altering default values using hook_form_alter is foiled by a form_alter located at includes/alter.inc. This form_alter is completely redundant, as it is already called by theme-settings.php.
Since the theme's form_alter runs after any module's form alter, it is impossible for modules to change the contents of the form.
Comment | File | Size | Author |
---|---|---|---|
#1 | removes-redundant-form-alter-2356687.patch | 724 bytes | josesanmartin |
Comments
Comment #1
josesanmartin CreditAttribution: josesanmartin commentedAdding patch
Comment #2
Taiger CreditAttribution: Taiger commentedI had trouble applying the patch directly. However, applying the changes manually fixes the bug and allows subthemes to alter the theme settings form.
Comment #3
markhalliwellComment #6
markhalliwellComment #7
markhalliwellActually this will be semi-reverted/fixed in #2451107: Fix bootstrap theme settings. I just remembered why there is a form alter to begin with.
theme-settings.php
is invoked before any module/theme has had a chance to alter the form thus, we cannot properly process alter the form from the file alone. I will move the majority of the "added" code back totheme-settings.php
, but limit what the alter does instead.Comment #8
markhalliwellThis has indeed been superseded/fixed by #2451107: Fix bootstrap theme settings.