-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Subtheme generation requires kalatheme to be default theme #215
Comments
Ok, so I think the root of this problem is here: https://www.drupal.org/node/943212
However if the currently enabled theme implements a So the first time through this gets called by Armed with this knowledge I'm putting together a PR that I think would let us fix this. |
@pirog—sorry to keep pinging you on these things but I wouldn't mind your eyes on the above PR to see if I'm overlooking something. The if statement that I removed was very specific, however, I assuming that it was to suppress errors due to the fact that sometimes #submit didn't exist and we didn't want to add our callbacks twice because the function was running twice. @pirog if you can confirm that there wasn't some other circumstance we were trying to avoid then this should be happy. I've tested it locally with kalatheme as default and with seven as default. I guess it would probably be wise to test on Pantheon too seeing that is another place we support subtheme generation. |
I think the reason we had this check was that sometimes Could dedupe the arrays further down with |
@pirog That's good because I think I got to the bottom of why those callbacks were being added twice. See my comment above for full details but basically |
@RobLoach was there a reason you added the above link? |
#216 has been tested and merged |
I've generated two subthemes, one as default and the second as an admin theme, but I'm not able to save the default theme settings. If I disable the admin theme everything works fine. Has this something to do with the issue above? |
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() :
The 'Build and enable a custom subtheme' checkbox is ajaxified and checking it rebuilds the form.
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.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.
The text was updated successfully, but these errors were encountered: