Make WordPress Core

Opened 5 weeks ago

Last modified 9 days ago

#63399 new defect (bug)

Twenty Twenty-Five: editor style isn't enqueued

Reported by: wildworks's profile wildworks Owned by:
Milestone: 6.8.2 Priority: high
Severity: normal Version: 6.7
Component: Bundled Theme Keywords: has-patch dev-feedback has-test-info
Focuses: Cc:

Description

Twenty Twenty-Five has `add_editor_style` function to enqueue styles for the editor.

However, since the parameter get_parent_theme_file_uri( 'assets/css/editor-style.css' ) generates a URL, not a relative path to the stylesheet file, the editor style isn't enqueued.

The correct code should be:

add_editor_style( 'assets/css/editor-style.css' );

Attachments (1)

63399.patch (642 bytes) - added by dhruvang21 5 weeks ago.

Download all attachments as: .zip

Change History (8)

#1 @sabernhardt
5 weeks ago

  • Component changed from Themes to Bundled Theme

@dhruvang21
5 weeks ago

#2 @dhruvang21
5 weeks ago

  • Keywords has-patch added

#3 @karmatosed
5 weeks ago

  • Keywords needs-testing added

I would like to get some testing on this specifically because older themes we have historically left with editor styles.

#4 @wildworks
5 weeks ago

Testing Instructions

Steps to Reproduce

  1. Open a post.
  2. Apply a link to the text.
  3. 🐞 The underline style does not match that of the front end.

Expected Results

  • ✅ The underline style matches that of the front end.
  • ✅ Works in both the post editor and the site editor.
  • ✅ I can override the CSS for the editor from my child theme by using twentytwentyfive_editor_style in my child theme.

#5 @SirLouen
5 weeks ago

  • Keywords dev-feedback has-test-info added; needs-testing removed

Test Report

Description

This report validates that the indicated patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/63399/63399.patch

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.4.6
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.4.6)
  • Browser: Chrome 136.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  • ✅ Issue resolved with patch.

Additional Notes

Followed these instructions

Supplemental Artifacts

Frontend underline

https://i.imgur.com/enetoyZ.png

Backend underline before patch:
https://i.imgur.com/XshboQW.png

Backend underline after patch:
https://i.imgur.com/sA77eDJ.png

#6 @sabernhardt
5 weeks ago

  • Milestone changed from Awaiting Review to 6.9
  • Priority changed from normal to high

I did not experience the issue with my local (Windows) installation, but I found the error with a live site (nginx). The fifth style tag printed in the body of the post editor iframe gave a 401 Authorization Required error instead of the editor styles.

With the patch, a child theme can override the stylesheet with anything when it uses the twentytwentyfive_editor_style() function. The patch also adds the ability to override the editor styles by uploading another stylesheet at assets/css/editor-style.css within the child theme.

#7 @audrasjb
9 days ago

  • Milestone changed from 6.9 to 6.8.2

Moving for 6.8.2 consideration given this has high priority.

Note: See TracTickets for help on using tickets.