Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#59417 closed defect (bug) (fixed)

`load-styles.php` no longer outputs styles after deprecating TEMPLATEPATH

Reported by: iandunn's profile iandunn Owned by: flixos90's profile flixos90
Milestone: 6.4 Priority: highest omg bbq
Severity: normal Version: 6.4
Component: Themes Keywords: has-patch
Focuses: template, performance Cc:

Description

It looks like load-styles.php no longer outputs anything after r56635.

  1. Activate TwentyTwentyThree (maybe not necessary)
  2. git checkout ec21b604e0. This is the Git equivalent of r56635.
  3. curl -s https://wp-develop.test/wp-admin/load-styles.php?load=l10n,wp-auth-check. You should see empty output.
  4. git co @~1. Check out the commit before r56635.
  5. curl -s https://wp-develop.test/wp-admin/load-styles.php?load=l10n,wp-auth-check. You should see a couple dozen lines of CSS.

I think the problem may be related to how load-styles.php includes noop.php, so the call to get_option() in get_stylesheet() will return null. Similar things may happen with regards to hooks.

noop.php doesn't include a stub for has_filter(), though, which may cause further unexpected behavior in get_stylesheet_directory().

On wordpress.org we also saw wp-admin load without any CSS, but I wasn't able to quickly reproduce that in a clean install. It may be due to using a parent block theme or some other customization.

Change History (8)

#1 @Otto42
18 months ago

  • Priority changed from normal to highest omg bbq

#2 @flixos90
18 months ago

@iandunn Thanks for flagging, I'm looking into it right now.

Either I'll find a solution really quickly, or I'll revert to be able to take a closer look to come up with a fix tomorrow.

#3 @flixos90
18 months ago

It's definitely coming from the changes in https://core.trac.wordpress.org/changeset/56635/trunk/src/wp-includes/theme.php. Reverting those locally has the styles working again.

This ticket was mentioned in PR #5268 on WordPress/wordpress-develop by @flixos90.


18 months ago
#4

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/59417

#5 @flixos90
18 months ago

  • Milestone changed from Awaiting Review to 6.4
  • Owner set to flixos90
  • Status changed from new to assigned

This simple patch fixes the fatal error, admin styles working again with that addition: https://github.com/WordPress/wordpress-develop/pull/5268

#6 @flixos90
18 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 56641:

Themes: Fix fatal error in load-styles.php.

Following [56635], a fatal error occurred in load-styles.php leading to admin styles not working, because of a has_filter() call being added to get_stylesheet_director() and get_template_directory().

This changeset adds has_filter() to wp-admin/includes/noop.php to prevent such errors. The lack of loading the function does not cause any unintended side effects itself.

Props iandunn, adamsilverstein.
Fixes #59417.
See #18298.

#8 @peterwilsoncc
18 months ago

#59418 was marked as a duplicate.

Note: See TracTickets for help on using tickets.