creating a template through appearance/delta for a theme such as "Fusion", then configuring that template at:

admin/appearance/delta/list/fusion/configure

results in lots of errors

Notice: Undefined index: theme_grid in fusion_core_form_system_theme_settings_alter() (line 68 of /Users/drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: in fusion_core_form_system_theme_settings_alter() (line 68 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: fluid_grid_width in fusion_core_form_system_theme_settings_alter() (line 81 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: in fusion_core_form_system_theme_settings_alter() (line 81 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: sidebar_layout in fusion_core_form_system_theme_settings_alter() (line 93 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: in fusion_core_form_system_theme_settings_alter() (line 93 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: sidebar_first_width in fusion_core_form_system_theme_settings_alter() (line 109 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: in fusion_core_form_system_theme_settings_alter() (line 109 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: sidebar_second_width in fusion_core_form_system_theme_settings_alter() (line 117 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: in fusion_core_form_system_theme_settings_alter() (line 117 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: theme_font_size in fusion_core_form_system_theme_settings_alter() (line 158 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).
Notice: Undefined index: in fusion_core_form_system_theme_settings_alter() (line 158 of /drupal-7.2/sites/all/themes/fusion/fusion_core/theme-settings.php).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sheena_d’s picture

Title: creating a template for a non supported theme gives errors » Theme Settings form should derive the theme's name from a more reliable variable
Project: Delta » Fusion
Version: 7.x-3.0-beta9 » 7.x-2.0-beta1
Status: Active » Needs review
FileSize
665 bytes
638 bytes

This issue was originally posted in the Delta issue queue, but is actually caused by the way Fusion processes theme settings.

Fusion dynamically renders some theme settings based on information in the theme's .info file. To do this, Fusion core needs to know the name of the theme whose settings are currently being edited and uses the following code to find this information:

   $theme_name = arg(count(arg()) - 1);

This works just fine on the standard theme settings page, but when the Delta module duplicates the theme settings page for creating Delta templates, it does not use the URL format expected in this code.

A more reliable method for determining the theme name seems to be the $form_build variable:

  $theme_name = $form_state['form_build']['args'][0];

This works well in my limited testing for both the Delta module's theme settings form and the standard Drupal theme settings form. I am not 100% sure that there are not other contexts in which my method would cause problems.

Another possible solution would be that Delta should use the expected URL structure for the path to its theme settings forms (i.e. end the path with the theme's machine name), but I do not think a module has any responsibility to uphold this pattern.

Attached are two patches; one applies to the current 7.x-2.x-beta1 release of Fusion, the other applies to the current 7.x-2.x-dev (Dec 20) version of Fusion.

sheena_d’s picture

argh, sorry, I totally typo'd those last patches. Use these patches instead!

Status: Needs review » Needs work

The last submitted patch, fusion-2.x-dev-theme-settings.patch, failed testing.

sheena_d’s picture

Status: Needs work » Needs review

The second patch failed testing because it applies to the dev release rather than the release that is tagged in this ticket.

sheena_d’s picture

After some consultation from @sociotech, I've changed the method for identifying the theme name to use the global variable $theme_key.

jinhcc’s picture

sheena_d’s picture

Status: Needs review » Fixed

This fix is included in Fusion 7.x-2.0-beta2

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

removing local paths

  • Commit cbbb940 on master, 7.x-2.x by sheena_d:
    #1397838  Theme settings form should derive the theme's name from a more...