#58712 closed defect (bug) (fixed)
Live Preview for block themes doesn't work with beta 3
Reported by: | nithins53 | Owned by: | isabel_brison |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | Themes | Keywords: | has-patch |
Focuses: | ui, administration, template | Cc: |
Description
Once we install a block theme and select the Live Preview option, the site editor still displays our currently active theme and not the selected one. But on the left-hand sidebar, it still shows the name of the respective theme that we trying to preview. Also activating the theme from the live preview won’t apply the new theme.
Steps to reproduce:
Install a block theme
Select the live preview
The preview shows the name correctly on the left-hand side but on the right-hand side, the theme is not previewed properly.
Selecting Activate won’t change the theme.
Attachments (3)
Change History (30)
#3
@
18 months ago
Hi!
Thank you for the report. This is also reported in the Gutenberg GitHub repository:
https://github.com/WordPress/gutenberg/issues/52309
#4
@
18 months ago
@poena Thank you for sharing the link, but is it on Github where we should be reporting the issue of the beta releases or here on trac?
This ticket was mentioned in PR #4795 on WordPress/wordpress-develop by @scruffian.
18 months ago
#5
- Keywords has-patch added; needs-patch removed
This makes a few changes to block theme previews:
- Adds a nonce so that activation works. This is needed until we have a REST API endpoint for activating themes
- Loads the theme-previews code in both wp-admin and in the REST API. This means moving the include to wp-settings.php - there may be a better place for this, the point is that we need to apply the filters in both wp-admin and in the API, so we need to move it out of admin-filters. I also moved the file itself out of wp-admin into wp-includes, since we use it in more situations.
Also ensure that we always load the filters even outside of wp-admin.
Trac ticket: https://core.trac.wordpress.org/ticket/58712
#6
@
18 months ago
I have a fix for this here: https://github.com/WordPress/wordpress-develop/pull/4795
jomonthomaslobo commented on PR #4795:
18 months ago
#7
Thanks for the fix
#8
follow-up:
↓ 14
@
18 months ago
I have tested the patch but faced an error in relation with the file path (src/wp-settings.php) and the back-end failed to load.
#9
@
17 months ago
- Milestone changed from Awaiting Review to 6.3
- Version set to trunk
Moving to 6.3 for visibility.
#10
@
17 months ago
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/4795
Environment
- OS: macOS 13.4.1
- Web Server: nginx/1.23.1
- PHP: 7.4.30
- WordPress: 6.3-beta3-56130-src
- Browser: Chrome Version 114.0.5735.198, Firefox 115.0
- Theme: Twenty Twenty-Two, Twenty Twenty-Three, FSE Eleven.
- Active Plugins: none
Actual Results
- ✅ Issue resolved with patch.
Additional Notes
- Both preview and activation works well.
#11
@
17 months ago
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/4795
Environment
- WordPress: 6.3-beta3-56143
- PHP: 8.1.6
- Server: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.1.6
- Database: mysqli (Server: 10.4.24-MariaDB / Client: mysqlnd 8.1.6)
- Browser: Chrome 109.0.0.0 (Windows 10/11)
- Theme: Twenty Twenty-Three 1.1
- MU-Plugins: None activated
- Plugins:
- WordPress Beta Tester 3.5.0
Actual Results
- ✅ Issue resolved with patch.
Additional Notes:
Both the preview and activation works.
#12
@
17 months ago
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/4795
Environment
- WordPress: 6.3-beta3-56143
- PHP: 8.1.6
- Server: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.1.6
- Database:mysqli (Server: 10.4.24-MariaDB / Client: mysqlnd 8.1.6)
- Browser: Chrome 114.0.0.0 (Windows 10/11)
- Theme: Twenty Twenty-Three 1.1
- MU-Plugins: None activated
- Plugins:
- WordPress Beta Tester 3.5.0
Actual Results
1.✅ Issue resolved with patch.
Additional Notes:
Both the preview and activation works.
#13
@
17 months ago
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/4795
Environment
- WordPress: 6.3-beta3-56143
- PHP: 8.1.6
- Server: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/8.1.6
- Database: mysqli (Server: 10.4.24-MariaDB)
- Browser: Chrome 109.0.0.0 (Windows 10/11)
- Theme: Twenty Twenty-Three
- MU-Plugins: None activated
- Plugins:
- WordPress Beta Tester 3.5.0
Actual Results
- ✅ Issue resolved with patch.
#14
in reply to:
↑ 8
@
17 months ago
Replying to nithi22:
I have tested the patch but faced an error in relation with the file path (src/wp-settings.php) and the back-end failed to load.
The issue was on my end, retested the patch and it works fine.
#15
@
17 months ago
Test Report
PR Tested: https://github.com/WordPress/wordpress-develop/pull/4795
wp --info
OS: Linux 5.19.0-46-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21 15:35:31 UTC 2 x86_64
Shell: /bin/bash
PHP version: 8.2.7
MySQL binary: /usr/bin/mysql
MySQL version: mysql Ver 8.0.33-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))
WP-CLI version: 2.8.1
Result
This PR solves the issue related to block theme's live preview.
17 months ago
#16
@scruffian / @peterwilsoncc would this make it into 6.3 still?
here is the trac ticket:
https://core.trac.wordpress.org/ticket/58712
cc @tellthemachine @azaozz ?
@scruffian commented on PR #4795:
17 months ago
#17
This needs to go into 6.3, or we need to take block theme previews out of 6.3.
@peterwilsoncc commented on PR #4795:
17 months ago
#18
@scruffian @bph I submitted the PR https://github.com/WordPress/gutenberg/pull/52398 to rename the variable to use an WP_
prefix. This is good to go in to 6.3 but the upstream PR will need to be included at the same time.
#19
@
17 months ago
- Owner set to isabel_brison
- Resolution set to fixed
- Status changed from new to closed
In 56199:
#22
@
17 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening this as @antonvlasenko picked up an escaping bug that will need to be fixed. It's pretty minor as it will only affect custom nonce implementations using special characters.
This ticket was mentioned in PR #4832 on WordPress/wordpress-develop by @peterwilsoncc.
17 months ago
#23
Adds escaping to the output of the nonce for activating themes while previewing. While escaping isn't required for the core implementation of nonces, it is for custom implimentations that may include special characters such as '
or ;
.
https://core.trac.wordpress.org/ticket/58712
Follow up to r56199 / 78135240236a366df708db7a21290db08ab21644
@ramonopoly commented on PR #4832:
17 months ago
#24
Tested as part of https://github.com/WordPress/wordpress-develop/pull/4832 LGTM
I was able to reproduce this issue in localhost also.
video url: https://www.loom.com/share/48f1f73432304de1bf88f57e4fb9fb9f?sid=d0bd8ba3-416a-4ead-8c94-5437fb555143