current code:
$function = $key .'_settings';
$group = $function($settings);
$form['theme_specific'] = array_merge($form['theme_specific'], $group);
so, if themename_settings contains $form['#submit'],
that ends up in $form['theme_specific']['#submit'] not $form['#submit'] as expected
thus breaking custom #submit handlers and i would imagine #validate, #after_build handlers and #redirect and #theme overrides.
This is critical because it wastes time of developers,
who have been clearly told they can use standard forms API, but can't. :(
Comments
Comment #1
treksler commentedquick patch that fixes the submit handler by applying any keys starting with a '#' above the 'theme_specific' fieldset
Comment #2
treksler commentedoops typo
Comment #3
treksler commentedCleaner patch without duplication
Comment #4
treksler commentedOf course another way to fix it would be to get rid of the 'theme_specific' and 'engine_specific' fieldsets, which IMO should be considered, since AFAICS Drupal 7 does not have them.
Comment #5
treksler commentedhere's a patch that just eliminates the fieldset .. if people want their overrides to be in a fieldset, they can make one in theme-settings.php .. this gives them more control over the name of the fieldset as well without requiring a theme override in template.php .. this also simplifies adding custom settings into existing fieldsets .. eg breadcrumb display into 'Toggle display' and a logo link into the 'logo image settings' .. and like i said in my previous comment, as far as i know, this is the way Drupal 7 does it.
Comment #6
treksler commentedoops, forgot to attach patch
Comment #7
treksler commentedactually, Drupal 7 seems to call a form alter for theme specific AND for engine specific settings, so no separate 'theme_specific' or 'engine_specific' fieldset is required, but Drupal 7 creates an 'engine_specific' fieldset anyway, but does not stuff anything in there by default.
Comment #8
treksler commentedhere's the latest patch that aims to be more forward compatible with Drupal 7 .. I basically turn the settings into a real form alter ..
note1: foo_settings($settings) becomes foo_form_system_theme_settings_alter($form_id, &$form) in Drupal 5
note2: the form alter is responsible for getting the settings (see below for an example)
note3: the form alter is responsible for adding any fieldset (there isn't one built in anymore)
note4: all submit handlers just work :))
Comment #9
treksler commentedComment #10
pomliane commentedThis version of Theme Settings API is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.