Opened 21 months ago
Closed 20 months ago
#57903 closed defect (bug) (fixed)
Non-core blocks are not properly loading RTL stylesheets
Reported by: | david.binda | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.2.1 | Priority: | normal |
Severity: | normal | Version: | 6.1.1 |
Component: | Editor | Keywords: | has-patch fixed-major |
Focuses: | css, rtl | Cc: |
Description
This is a follow-up to #56325 where an issue for core-blocks has been reported. There's also #56797 which adds PHPUnit tests for RTL stylesheets loading, however the current logic introduced in r54330 only works in a situation when the SCRIPT_DEBUG
is defined and set to true
(which is the case during the PHPUnit tests being run).
When the SCRIPT_DEBUG
is set to false
, the -rtl
styles for non-core blocks are not being loaded.
To reproduce the issue, I used the blocks-non-jsx/02-stylesheets block of the gutenberg examples repository and added a modified style-rtl.css file to the block.
On a site in one of the RTL languages, I added the block to a post and it can be seen on a frontend that the style-rtl.css is only loaded when the SCRIPT_DEBUG
is set to true
.
The bug seems to be due to the fact that core blocks' styles are being loaded with `.min` suffix, while non-core ones are never using the minified files, but the suffix is always being taken into consideration when the -rtl file lookup is performed.
Attachments (1)
Change History (8)
#3
@
21 months ago
It's not immediate clear to me how to add a unit test for this change, as reproducing the issue requires SCRIPT_DEBUG
to be set to false
, and it is already set to true
when the test suite is run. That said, I've double-checked the logic and it looks correct to me.
#4
@
21 months ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 55544:
Thanks for the ticket and the patch!
Moving for 6.2.1 consideration, as it's not a regression in 6.2 but should be fixed sooner rather than later.