Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#42126 closed defect (bug) (fixed)

Customize: Fix confusion related to visibility of Themes panel and drafted/scheduled changesets

Reported by: westonruter's profile westonruter Owned by: westonruter's profile westonruter
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Customize Keywords: has-patch
Focuses: Cc:

Description

With the addition of drafting and scheduling of changesets in #39896, we do not allow for theme switching to be done when a changeset has been saved as a draft or scheduled. There are a few technical reasons for this:

  • Changesets cannot be scheduled with a theme switch. This is because when a changeset post gets published during WP Cron, the new theme is not active and so none of the theme-specific settings will be loaded.
  • Publish settings section not available for theme preview because non-authoritative users cannot preview theme switch, so presenting the “preview link” control could result in users not being able to access it.
  • The previewed theme is not stored in the changeset, and so when returning to the Customizer later the theme being previewed at the time of saving would not then be restored. See #39031.

There may be future ways around these issues, but for 4.9 the scope is to just disable theme switching when you have drafted or scheduled changes.

However, there are currently two issues with the current implementation:

  1. As soon as you switch the status to draft or scheduled, the Themes panel disappears without warning. Users will not know where it went and why. There needs to be a notification explaining why they cannot switch themes. See conversation at https://wordpress.slack.com/archives/C0381N237/p1506983729000264
  2. If you have drafted or scheduled a changeset, if you go to the Themes admin screen and click Live Preview for a different theme, the Customizer is currently allowing the theme preview even though it has autoloaded the pending changeset. This results in the themes panel being hidden even though the button says "Activate & Publish". This is wrong, and when the Customizer is loaded with a non-active theme then we need to prevent establishing an existing changeset (and so a new changeset would be created as in branching mode). Reported here: https://wordpress.org/support/topic/unable-to-see-new-theme-browsing-experience-in-customizer/

Attachments (1)

theme-browser-scheduled-warning-flow.jpg (891.1 KB) - added by melchoyce 7 years ago.

Download all attachments as: .zip

Change History (10)

#2 @westonruter
7 years ago

  • Keywords has-patch added
  • Owner set to melchoyce
  • Status changed from new to reviewing

#3 @westonruter
7 years ago

  • Owner changed from melchoyce to westonruter
  • Status changed from reviewing to accepted

I just found that that the changes didn't account for the theme installation flow. I need to fix that.

#4 @westonruter
7 years ago

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

In 41788:

Customize: Fix confusion related to visibility of Themes panel with drafted/scheduled changesets.

  • Prevent autoloading an existing draft/future changeset when theme not active.
  • Add missing notifications container to Themes panel.
  • Remove deactivation of themes panel when selected status is not publish.
  • Show notification in Themes panel when themes cannot be previewed and disable preview buttons.
  • Reject installTheme call when theme preview not available.
  • Return promise from installTheme and eliminate use of global events in favor of promises.

Props westonruter, melchoyce, zoonini.
See #37661, #39896.
Fixes #42126.

#5 @westonruter
7 years ago

In 41997:

Customize: Prevent theme installation and deletion in Customizer while SFTP credentials need to be requested.

This is a temporary measure while we wait for credentials to be able to be supplied in the Customizer.

Amends [41788].
See #42184, #37661, #42126.

#6 @westonruter
7 years ago

In 42107:

Customize: Prevent re-importing starter content when changeset is saved as draft or scheduled.

Themes cannot currently be switched in Customizer after changeset is saved anyway.

Props dlh, westonruter.
See #40146, #42411, #42126.
Fixes #42395.

This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.


7 years ago

#8 @westonruter
7 years ago

In 42113:

Customize: Make sure theme switch blocking in the Customizer is consistently applied when changeset is drafted/scheduled.

  • Consider both selectedChangesetStatus and changesetStatus states when deciding to disable.
  • Factor out common logic into canSwitchTheme function on ThemesPanel.
  • Keep Live Preview and Install buttons disabled in Themes controls and detail overlays when appropriate.

Props westonruter, dlh.
Amends [41788].
See #42126, #37661, #39896.
Fixes #42406.

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


7 years ago

Note: See TracTickets for help on using tickets.