Skip to content

Subtheme generation requires kalatheme to be default theme #215

Open
@soniktrooth

Description

@soniktrooth

When trying to generate a sub theme nothing happens unless kalatheme is selected as the admin theme. I have tracked it down to the following code inside of kalatheme_prepare_config_form() :

  if (isset($form['#submit']) && is_array($form['#submit']) && !in_array('kalatheme_custom_bootstrap_library_submit', $form['#submit'])) {
    // Add our submit function first
    array_unshift($form['#submit'], 'kalatheme_custom_bootstrap_library_submit');

The 'Build and enable a custom subtheme' checkbox is ajaxified and checking it rebuilds the form.

  • When Kalatheme is default theme kalatheme_prepare_config_form is run twice, first time $form['#submit'] doesn't exists so we never enter the if condition. Second time it does exist so the submit handler is added.
  • When Kalatheme is NOT default theme kalatheme_prepare_config_form only runs once, $form['#submit'] doesn't exists so we never enter the if condition.

WHY the function gets run twice when kalaltheme is default and once when not is the big mystery here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions