Customize: Fix logic inversion in [42113] which prevented themes from being installed in Customizer.

Also fix PHP notice related to parent themes and WordPress.org theme query results.

Props dd32, obenland, celloexpressions, westonruter, atachibana for testing.
See #42406, #37661.
Fixes #42442.


git-svn-id: https://develop.svn.wordpress.org/trunk@42122 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2017-11-07 04:16:11 +00:00
parent 6f8428e8b5
commit a397b8f6bb
2 changed files with 11 additions and 3 deletions

View File

@@ -3202,7 +3202,7 @@
}
// Prevent loading a non-active theme preview when there is a drafted/scheduled changeset.
if ( panel.canSwitchTheme( slug ) ) {
if ( ! panel.canSwitchTheme( slug ) ) {
deferred.reject({
errorCode: 'theme_switch_unavailable'
});
@@ -3299,7 +3299,10 @@
// Prevent loading a non-active theme preview when there is a drafted/scheduled changeset.
if ( ! panel.canSwitchTheme( themeId ) ) {
return deferred.reject().promise();
deferred.reject({
errorCode: 'theme_switch_unavailable'
});
return deferred.promise();
}
urlParser = document.createElement( 'a' );