Steps to reproduce:

  • Go to admin/build/themes/settings (Themes -> configure -> global settings).
  • Toggle any of the checkboxes.
  • Click the “Save configuration” button.

The resulting page says “The configuration options have been saved.” but the settings still show the defaults and not the changes.

The theme_settings variable in the variable database table does not show the changes either.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Status: Active » Postponed (maintainer needs more info)

this is working on my box. i'm using the build i've downloaded some minutes ago.

hass’s picture

Status: Postponed (maintainer needs more info) » Active

ignore my last posting, i tested on 5.x-dev... :-(. Under 6.x-dev i'm able to repro this bug, too.

hass’s picture

save on a theme specific settings page additional gives me this error:

notice: Undefined variable: file in C:\Inetpub\wwwroot\drupal6\modules\color\color.module on line 224.
hass’s picture

check out http://drupal.org/node/138706... maybe the cause?

riccardoR’s picture

Status: Active » Needs review
FileSize
412 bytes

I think hass is right.
The theme_seetings variable is no longer stored in the variable database table as a serialized array (like in Drupal 5), but as a set of independent values :

var  	s:14:"theme_settings";  	 // this var is really called "var"
toggle_logo 	i:1; 	 
toggle_name 	i:1; 	 
toggle_slogan 	i:0; 	 
toggle_mission 	i:1; 	 
toggle_node_user_picture 	i:0; 	 

etc., etc. and the last one is:
form_build_id 	s:32:"c7e1b97b6f8b01e3ba718a98a3aed739";

This make me think of an error in the settings form submit handling because of the different logic in FormAPI3.
I have tried to set the appropriate form submit handler in system_theme_settings() getting inspiration from system_admin_theme_settings() that is working. This change has restored the correct behaviour :

  $form['#attributes'] = array('enctype' => 'multipart/form-data');
  $form['#submit'][] = 'system_theme_settings_submit';     // I ADDED ONLY THIS LINE at the end of system_theme_settings() 

  return system_settings_form($form);
}

Patch against HEAD attached.
I am not sure if this is the orthodox solution, but at least it fixes the issue: now I am able to save any theme settings.

BTW, I cannot access the theme specific pages, with or without this patch.

Thanks,
Riccardo

JohnAlbin’s picture

Title: Theme settings not saved » #submit issues with system_settings_form() and Theme settings not saved
FileSize
1.91 KB

The FAPI3 patch (#138706) is indeed the issue.

system_settings_form() is modified to include these lines:

  $form['#submit'][] = 'system_settings_form_submit';
  $form['#validate'][] = 'system_settings_form_validate';

Which means system_settings_form_submit() is called instead of system_theme_settings_submit().

This patch fixes that issue.

BONUS: because of the additions to system_settings_form(), the Administration Theme and Performance forms were showing “The configuration options have been saved.” twice when submitted. The patch fixes that as well.

JohnAlbin’s picture

Title: #submit issues with system_settings_form() and Theme settings not saved » Theme settings not saved (+ 2 system forms submitted twice)
Dries’s picture

John's patch looks good. Feel free to RTBC this after you confirmed that it fixes the problem.

Good catch.

JohnAlbin’s picture

Status: Needs review » Reviewed & tested by the community

I’ve verified the patch fixes all 3 forms.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS. Thanks, John.

Anonymous’s picture

Status: Fixed » Closed (fixed)