[wp-trac] [WordPress Trac] #42442: Install & Preview of themes doesn't work.
WordPress Trac
noreply at wordpress.org
Mon Nov 6 05:48:32 UTC 2017
#42442: Install & Preview of themes doesn't work.
--------------------------+-------------------------
Reporter: atachibana | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.9
Component: Customize | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: javascript
--------------------------+-------------------------
Changes (by celloexpressions):
* keywords: => needs-patch
* focuses: => javascript
Comment:
This appears to have been caused by [42113]. The check starting at line
3205 of `customize-controls.js` is incorrectly failing, and preventing the
theme installation from being initialized:
{{{
// Prevent loading a non-active theme preview when there is a
drafted/scheduled changeset.
if ( panel.canSwitchTheme( slug ) ) {
deferred.reject({
errorCode: 'theme_switch_unavailable'
});
return deferred.promise();
}
}}}
Commenting out that check, everything works. Looking at
`canSwitchTheme()`, I'm guessing that the root issue is with the initial
changeset status that gets set on a fresh load. The following line is
returning false:
{{{
return 'publish' === api.state( 'selectedChangesetStatus' ).get() && ( ''
=== api.state( 'changesetStatus' ).get() || 'auto-draft' === api.state(
'changesetStatus' ).get() );
}}}
(Yes, the other issues are unrelated, but would be great to get cleaned up
before release. I believe the documentation for a few aspects of that API
was incomplete when the feature was first worked on last year; looks like
those preliminary code comments slipped through without a review by anyone
more familiar with it. If possible, it would be helpful for you to audit
all of the related .org API calls for this feature for correctness @dd32.
There should be todos or question-oriented comments for anything that
seemed to behave oddly at any point.)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42442#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list