There is a bug in Drupal core that make the hook_form_system_theme_settings_alter() function called twice when displaying the settings page for the currently active theme: #1135794: Introduce hook_settings() for themes.

The fact that samara_form_system_theme_settings_alter() removes the 'theme_settings' entry from the $form array causes a PHP notice on the second pass.

Even if this issue was fixed in the commit c06312a383a7a515c1556c747ceda8765ea93e98, the Drupal core bug is still not resolved.

Because Samara intend to be an administration theme, I think it should take care of that.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

B-Prod’s picture

The patch below moves the theme settings to a vertical tab and take care of the Drupal core bug explained above.

Chi’s picture

Status: Active » Postponed (maintainer needs more info)

Could you provide steps to reproduce the bug?

B-Prod’s picture

Status: Postponed (maintainer needs more info) » Needs review

1. Activate the module
2. Go to the Samara settings page

That's all, with a debugger you can add a breakpoint on the samara_form_system_theme_settings_alter() function, you will see that the function is called twice, due to a Drupal core inconsistency.

When using Samara old way (vertical tab for theme default settings with unset()), this throw an error since the $form['theme_settings'] no more exists in the second pass.

The patch above allows to keep use of the vertical tab and take care of the Core bug.

Chi’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.