Project

General

Profile

Actions

Bug #19447

closed

SOS! Home page seems broken

Added by Marilyn Weber 4 months ago. Updated 3 months ago.

Status:
Resolved
Priority name:
Urgent
Assignee:
Category name:
WordPress Themes
Target version:
Start date:
2023-12-20
Due date:
% Done:

0%

Estimated time:
Deployment actions:

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
Actions #1

Updated by Marilyn Weber 4 months ago

Actions #2

Updated by Colin McDonald 4 months ago

  • Assignee set to Boone Gorges

Adding Boone as assignee and dev team and others as watchers. I'm seeing the same thing.

Actions #3

Updated by scott voth 4 months ago

Also seeing the same thing.

Actions #4

Updated by scott voth 4 months ago

seems to be back and working again

Actions #5

Updated by Raymond Hoh 4 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.

Actions #6

Updated by Marilyn Weber 4 months ago

I had just been starting to crate a new site when I saw it. But the site isn't a clone.

Actions #7

Updated by Raymond Hoh 4 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?

Actions #8

Updated by Colin McDonald 4 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.

Actions #9

Updated by Marilyn Weber 4 months ago

Possibly me - phdhistory.commons.gc.cuny.edu

But I see others from today

Actions #10

Updated by Raymond Hoh 4 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?

Actions #11

Updated by Marilyn Weber 4 months ago

Argh, sorry! I thought I'd match the theme for my new site (but of course that's impossible)

Actions #12

Updated by Matt Gold 4 months ago

Sorry for my late reply -- I saw the email from Colin come in earlier today and then looked quickly at Redmine to see that Ray was on the case. Huge thanks for reporting this, Marilyn, for raising the alarm by email, Colin, and for fixing things, Ray!!

Actions #13

Updated by Boone Gorges 4 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.

Actions #14

Updated by Raymond Hoh 4 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?

Actions #15

Updated by Boone Gorges 3 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.

Actions #16

Updated by Raymond Hoh 3 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.

Actions

Also available in: Atom PDF