Bug #19447
closedSOS! Home page seems broken
Added by Marilyn Weber 11 months ago. Updated 10 months ago.
0%
Description
Or is at least very strange looking
Files
Screenshot 2023-12-20 161443.jpg (89.5 KB) Screenshot 2023-12-20 161443.jpg | Marilyn Weber, 2023-12-20 04:15 PM | ||
Screenshot 2023-12-20 161443.jpg (89.5 KB) Screenshot 2023-12-20 161443.jpg | Marilyn Weber, 2023-12-20 04:22 PM | ||
Screenshot 2023-12-20 170641.jpg (101 KB) Screenshot 2023-12-20 170641.jpg | Marilyn Weber, 2023-12-20 05:06 PM |
Updated by Marilyn Weber 11 months ago
- File Screenshot 2023-12-20 161443.jpg Screenshot 2023-12-20 161443.jpg added
- Priority name changed from Normal to Urgent
Updated by Colin McDonald 11 months ago
- Assignee set to Boone Gorges
Adding Boone as assignee and dev team and others as watchers. I'm seeing the same thing.
Updated by Raymond Hoh 11 months ago
The theme on the main site changed to twentytwelve
. I've changed it back to bp-nelo
.
Seems related to #18235. Will take a look.
Updated by Marilyn Weber 11 months ago
I had just been starting to crate a new site when I saw it. But the site isn't a clone.
Updated by Raymond Hoh 11 months ago
My 'template'
DB option logger caught when this occurred:
[20-Dec-2023 19:36:14] bp-nelo switched to twentytwelve for site ID 1: validate_current_theme, switch_theme, update_option, apply_filters('pre_update_option_template'), WP_Hook->apply_filters, {closure}
Was anyone working on the site around 2:30pm EDT?
Updated by Colin McDonald 11 months ago
I was active around the site then I think, but only updating Redmine tickets and using the CAC team forum. I noticed the issue right after I posted my forum update, but that was more like an hour ago.
Updated by Marilyn Weber 11 months ago
Possibly me - phdhistory.commons.gc.cuny.edu
But I see others from today
Updated by Raymond Hoh 11 months ago
Marilyn Weber wrote in #note-9:
Possibly me - phdhistory.commons.gc.cuny.edu
But I see others from today
Hi Marilyn,
From looking at the server access logs, I can see that you visited the Themes admin dashboard page on the main site at around this time.
Whenever someone visits the Themes admin dashboard page, WordPress does a validation check for the current theme. For whatever reason, the check failed this time and whenever this check fails, WordPress will switch to the default theme, which is Twenty Twelve for us.
This is definitely not your fault, Marilyn! Chalk it up to weird WordPress happenstance.
Boone / Jeremy, I'm not sure why the theme validation check failed this time, but I think to safeguard us from this bug in the future, we can make sure to bypass this theme validation check on the main site with the following:
if ( is_main_site() ) { add_filter( 'validate_current_theme', '__return_false' ); }
What do you think?
Updated by Marilyn Weber 11 months ago
Argh, sorry! I thought I'd match the theme for my new site (but of course that's impossible)
Updated by Boone Gorges 11 months ago
Ray, thanks for diving in on this.
Your validate_current_theme
callback seems OK to me. I wonder if a more general fix would be a pre_option_template
and pre_option_stylesheet
filter? This would help to avoid other types of cases (aside from failed validation) where the theme might be accidentally switched.
Updated by Raymond Hoh 11 months ago
I wonder if a more general fix would be a pre_option_template and pre_option_stylesheet filter? This would help to avoid other types of cases (aside from failed validation) where the theme might be accidentally switched.
I actually did a version of this with the 'option_template'
filter during development of v2.2.0: https://github.com/cuny-academic-commons/cac/commit/2582798911a1e990c07fe7194132438c08b696ee, but this caused a fatal error during the site cloning process. See #19118. We could try a similar approach, but omit the check on the site creation page?
Updated by Boone Gorges 10 months ago
- Assignee changed from Boone Gorges to Raymond Hoh
- Target version set to 2.3.2
I actually did a version of this with the 'option_template' filter during development of v2.2.0: https://github.com/cuny-academic-commons/cac/commit/2582798911a1e990c07fe7194132438c08b696ee, but this caused a fatal error during the site cloning process. See #19118. We could try a similar approach, but omit the check on the site creation page?
Ah yes, I remember that now. Let's just stick with your validate_current_theme
approach.
Updated by Raymond Hoh 10 months ago
- Category name set to WordPress Themes
- Status changed from New to Resolved
While looking into #19493, I found the bug for this ticket. When we converted our bp-nelo theme over from a child theme to a parent theme, the bp-nelo theme was missing the index.php
template file. Thus when navigating to the "Appearance" admin dashboard page, WordPress would mark our bp-nelo theme as invalid and would revert the entire site to the Twenty Twelve theme.
I've added an index.php
template file for bp-nelo in https://github.com/cuny-academic-commons/cac/commit/5a305d46453efbae9818b1e4eedcc0e1a158bc0d , which should address this issue. This is deployed on production as well.