Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#54878 closed defect (bug) (fixed)

Don't show links to the Customizer when installing themes using api.wordpress.org

Reported by: antonvlasenko's profile antonvlasenko Owned by: audrasjb's profile audrasjb
Milestone: 5.9.3 Priority: normal
Severity: normal Version: 5.9
Component: Themes Keywords: has-patch has-screenshots commit fixed-major
Focuses: Cc:

Description (last modified by SergeyBiryukov)

I found this while working on #54578.

Steps to reproduce the bug:

  1. Go to Appearance -> Themes page.
  2. Click on the Add New button, then find the TT1 theme using the search functionality.
  3. Install the theme.

Expected result:
The Live Preview button is not displayed for block-based themes.

Actual result:
The Live Preview button is displayed for block-based themes.

Also, the Customize button is displayed for installed block themes when browsing the available themes. It also has to be removed.

Change History (16)

#1 @costdev
2 years ago

  • Milestone changed from Awaiting Review to 6.0

@antonvlasenko Thanks for opening this ticket!

Tested on trunk with the same results. Milestoning for 6.0.

Also, the Customize button is displayed for installed block themes when browsing the available themes. It also has to be removed.

In wp-admin/themes.php? If so, this Customize button goes to the Site Editor for block themes, isn't that okay? Alternatively, it might be worth changing Customize to Edit site in this context, for consistency with the Admin Bar, which changes from Customize for classic themes to Edit site for block themes.

#2 @antonvlasenko
2 years ago

@costdev
Thank you for the triage.
No, it's on the wp-admin/theme-install.php page.
To see the Customize button, install a block theme like TT1 from wordpress.org, then activate it.
Go to Appearance -> Themes page.
Click on the Add New button, then find the TT1 theme using the search functionality.
https://cldup.com/53esPkijw4.png

Last edited 2 years ago by antonvlasenko (previous) (diff)

#3 @antonvlasenko
2 years ago

I'm working on a patch for this issue.

This ticket was mentioned in PR #2349 on WordPress/wordpress-develop by anton-vlasenko.


2 years ago
#4

  • Keywords has-patch added; needs-patch removed

#5 @antonvlasenko
2 years ago

Steps to test this PR:

  1. Go to Appearance -> Themes page.
  2. Activate the Twenty Twenty-Two theme (if it's not active).
  3. Click on the Customize button for the Twenty Twenty-Two theme. It should take users to Site Editor.
  4. Click on the Add New button, then search for TT1 theme.
  5. Install the TT1 theme but don't activate it.
  6. The Live Preview button must not be displayed for the TT1 theme.

#6 @antonvlasenko
2 years ago

  • Keywords needs-testing added

#7 @ironprogrammer
2 years ago

Thanks for the patch, @antonvlasenko! tl;dr It appears that after the install action that the Live Preview button is not being removed, but is removed upon subsequent page loads.

Test Report

PR 2349

Env

  • WordPress 6.0-alpha-52448-src
  • Safari 15.3
  • macOS 12.2.1 (Monterey)
  • Theme: Twenty Twenty-Two
  • Gutenberg 12.7.0-rc.1 ENABLED 🟢 and DISABLED 🔴

Steps to Test

  1. On Appearance > Themes activate "Twenty Twenty-Two" theme.
  2. Observe active theme's Customize button points to /wp-admin/site-editor.php (with Gutenberg: /wp-admin/themes.php?page=gutenberg-edit-site).
  3. Click Add New and search for "tt1" ("TT1 Blocks" theme).
  4. Click Install for "TT1 Blocks" theme.
  5. Observe Live Preview button is visible and links to /wp-admin/customize.php?theme=tt1-blocks. ❌
  6. Refresh page (Reload or repeat Steps 1-3).
  7. Observe Live Preview button is removed. ✅

Expected Results (✅/❌)

  • In Step 4, it was expected that the Preview button would disappear after installation, but in Step 5 the button was replaced with Live Preview, pointing to the Customizer. ❌
  • After a page refresh in Step 6, the Live Preview button was successfully removed from the theme buttons (Step 7). Before the patch, the button was still present, and linked to the Customizer. ✅

#8 @antonvlasenko
2 years ago

Thank you so much for testing, @ironprogrammer!
I've fixed the issue you mentioned.
@costdev Would it be possible to move this track ticket to the 5.9.2 milestone, please?
This trac issue and #54578 (which is in the 5.9.2 milestone) are related, and both of them fix similar issues.

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

#9 @ironprogrammer
2 years ago

  • Keywords has-screenshots added; needs-testing removed

👍🏻 LGTM! The PR update has addressed the removal of the preview button immediately following installation of a block theme.

Test Report

PR 2349

Env

  • WordPress 6.0-alpha-52448-src
  • Safari 15.3 (w/ cleared cache)
  • Chrome 98.0.4758.109
  • macOS 12.2.1 (Monterey)
  • Theme: Twenty Twenty-Two
  • Gutenberg DISABLED 🔴

Steps to Test

  1. On Appearance > Themes activate "Twenty Twenty-Two" theme.
  2. Click Add New and search for "tt1" ("TT1 Blocks" theme).
  3. Click Install for "TT1 Blocks" theme.
  4. Observe the Preview button is removed, and not replaced with Live Preview. ✅
  5. Refresh page (Reload or repeat Steps 1-3).
  6. Observe Live Preview button is removed. ✅

Screenshots

https://cldup.com/MOQIYHJAfW.gif
On theme-install.php, Preview and Live Preview buttons are removed after block theme installation.

#10 @costdev
2 years ago

  • Keywords commit added
  • Milestone changed from 6.0 to 5.9.2

Thanks for the test reports @ironprogrammer!

@antonvlasenko Moving to the 5.9.2 milestone and flagging for commit consideration.

For committers: This ticket's issue has been identified, reproduced, patched, tested, improved, tested and confirmed. No outstanding issues or newly introduced regressions have been identified.

#11 @SergeyBiryukov
2 years ago

  • Description modified (diff)

peterwilsoncc commented on PR #2349:


2 years ago
#12

Committed in 567b2518f8d9207bc0da9c8f329fd969debdc2e2 (canonically https://core.trac.wordpress.org/changeset/52819)

#13 @peterwilsoncc
2 years ago

  • Keywords fixed-major added

Committed in [52819] but waiting for trac to catch up:

Themes: Hide block themes' live preview link following installation.

Prevent the Customizer/Live Preview button from showing for installed block themes when on the theme installation page.

Props antonvlasenko, costdev, ironprogrammer.
Fixes #54878.

#14 @audrasjb
2 years ago

  • Milestone changed from 5.9.2 to 5.9.3

Moving to milestone 5.9.3 since we're about to release 5.9.2.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


2 years ago

#16 @audrasjb
2 years ago

  • Owner set to audrasjb
  • Resolution set to fixed
  • Status changed from new to closed

In 53008:

Themes: Hide block themes live preview link following installation.

Prevent the Customizer/Live Preview button from showing for installed block themes when on the theme installation page.

Props antonvlasenko, costdev, ironprogrammer.
Merges [52819] to the 5.9 branch.
Fixes #54878.

Note: See TracTickets for help on using tickets.