All our admin/settings page no longer revert to default values when the [Reset to defaults] is pressed.

Comments

DriesK’s picture

Are you sure about that? Because what happens on my install is the following: the settings _are_ actually reset to the defaults, but right after hitting the reset button, the form still _shows_ the old values. But, once you click 'settings' in the menu, the correct (resetted) values are shown.

This is a consequence of the forms API. The resetting happens in system_settings_submit(), which is called by drupal_form_submit(). And drupal_form_submit() is called after _form_builder() in drupal_get_form(). So what happens is that a button of #type submit is clicked, causing the $_POST values to be inserted as #value in the form by _form_builder(), and $_POST obviously contains the current, unresetted values.

Not sure what's the best way to solve this though...

DriesK’s picture

and by drupal_form_submit() I meant drupal_submit_form() of course :-)

chx’s picture

You sure this has not been fixed lately by Steven's adding drupal_goto to system_settings_form_submit ? Or that patch is not yet in?

DriesK’s picture

You're right, Steven's patch was committed last night. I missed it. The problem is gone in latest HEAD for me. Bèr, can you confirm and close this issue if all works well for you?

Bèr Kessels’s picture

Status: Active » Fixed

DriesK, chx, yes, updating to head fixed this. It was indeed the goto issue that caused this "bug" to appear.

Thanks a lot for your time.

dries’s picture

Status: Fixed » Closed (fixed)