Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving certain site settings (E.g. in Advanced General) breaks/reverts theme #53447

Closed
khristiansnyder opened this issue Jun 7, 2021 · 13 comments
Assignees
Labels
[Pri] High Address as soon as possible after BLOCKER issues Triaged To be used when issues have been triaged. [Type] Bug User Report This issue was created following a WordPress customer report

Comments

@khristiansnyder
Copy link

khristiansnyder commented Jun 7, 2021

Summary

On a simple and AT sites, when any setting is changed in Advanced General, the theme breaks and completely reverts to a different theme or just shows broken/blank homepage for the site. I tested with Karuna and Twenty Twentyone active and after saving some new sittings in Advanced General, my test site switched to Twenty Fifteen.
WP-Admin/themes shows an error: The active theme is broken. Reverting to the default theme.

Steps to reproduce the behavior

  1. On a simple or AT site, make sure one of our internal themes is activated (such as Twenty Twentyone) and then save any setting in Settings ➤ Advanced General
  2. After saving the settings, the theme is broken and reverts to a different theme. For example, I had Twenty TwentyOne active, and that was reverted to Twenty Sixteen.
  3. WP-Admin ➤ Themes has an error: the active theme is broken. Reverting to the default theme.

Theme Break

Is this specific to the applied theme? Which one?

Seems to happen in both block-based themes and premium themes.

Does this happen on simple or atomic sites or both?

Simple and AT, but so far only tested themes in our internal library

@khristiansnyder khristiansnyder added [Type] Bug User Report This issue was created following a WordPress customer report labels Jun 7, 2021
@poojashetty18
Copy link

Another report on 30008759-hc
Theme: Verity

The AT site user also made changes to Advanced General settings and changed the New User Default Role from "Customer" to "Vendor"

@khristiansnyder khristiansnyder changed the title Saving settings in Advanced General breaks/reverts theme on simple sites. Saving settings in Advanced General breaks/reverts theme Jun 7, 2021
@khristiansnyder khristiansnyder changed the title Saving settings in Advanced General breaks/reverts theme Saving certain site settings (E.g. in Advanced General) breaks/reverts theme Jun 7, 2021
@cpapazoglou cpapazoglou added the [Pri] High Address as soon as possible after BLOCKER issues label Jun 7, 2021
@cpapazoglou
Copy link
Contributor

I have been looking to the issue, but still don’t have a clue.
It’s unrelated to nav-unification or the menu entry “Advanced General”.

Just a hint: It doesn't reproduce on eCommerce plans.

@cpapazoglou
Copy link
Contributor

cpapazoglou commented Jun 7, 2021

validate_current_theme returns false because file_exists( get_stylesheet_directory() . '/style.css' ) is false.

It seems that stylesheet option gets empty when saving the form in wp-admin/options-general.php

@katiebethbrown
Copy link

katiebethbrown commented Jun 7, 2021

If the stylesheet option is empty, could that also be what's causing the theme_mods_{themeslug} option to get overwritten with -, causing the issues we're seeing saving customizer changes?

#53431

If I'm reading it right (I might not be), JP sync uses the stylesheet option to sync the theme_mods:

https://github.com/Automattic/jetpack/blob/05de5b8f8fba2bd86c607abbc3e98e49c9cc739c/projects/packages/sync/src/modules/class-options.php#L228

@cpapazoglou
Copy link
Contributor

theme_mods_

I am not sure yet if these issues are related. FWIW, saving the form in wp-admin/options-general.php will both empty the stylesheet and theme_mods_{themeslug} as a result of both of them being in the $allowed_options array.

I am now trying to find how they get added there.

@cpapazoglou
Copy link
Contributor

Tested in an Atomic site, disabling Gutenberg plugin resolved the problem...

@cpapazoglou
Copy link
Contributor

I just booted a local Gutenberg 10.7.2 and the problem reproduces clearly over there!

@cpapazoglou
Copy link
Contributor

cpapazoglou commented Jun 7, 2021

@cpapazoglou
Copy link
Contributor

cpapazoglou commented Jun 7, 2021

Related convo about pushing a custom build for Simple sites p1623062896261500-slack-C7YPUHBB2

Atomic Sites will need to wait for the next release of Gutenberg on Wednesday Jun 9.p1623080514158400/1623076293.157800-slack-C45SNKV4Z

@cpapazoglou
Copy link
Contributor

Related convo about restoring the affected sites stylesheet & theme_mods_%
p1623083655133000-slack-C020SHYRB24

@formosattic
Copy link

+1 4048860-zd-woothemes

@synora synora added the Triaged To be used when issues have been triaged. label Jun 14, 2021
@cpapazoglou
Copy link
Contributor

We have stopped the spread of the issue and we are trying to restore the correct stylesheets to the affected blogs. It will be resolved as part of #53431. Let's continue the discussion there.

@cpapazoglou
Copy link
Contributor

#53431 (comment)

@cpapazoglou cpapazoglou self-assigned this Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Pri] High Address as soon as possible after BLOCKER issues Triaged To be used when issues have been triaged. [Type] Bug User Report This issue was created following a WordPress customer report
Projects
None yet
Development

No branches or pull requests

6 participants