[wp-trac] [WordPress Trac] #38455: Customizer: new theme browser in multisite is missing updates.js
WordPress Trac
noreply at wordpress.org
Sun Oct 23 13:31:57 UTC 2016
#38455: Customizer: new theme browser in multisite is missing updates.js
-----------------------------------+-----------------------------
Reporter: Offereins | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: trunk
Severity: normal | Keywords:
Focuses: javascript, multisite |
-----------------------------------+-----------------------------
Running latest 4.7 trunk on my local machine, no plugins active, I'm
testing the new theme browsing experience (see #37661) in a Multisite
installation and I found this bug.
When as a superadmin, both on the main site as on another subsite, trying
to install or install/preview a theme, the console logs the following
error, without the user receiving any visual feedback in the theme
browser:
{{{
Uncaught TypeError: Cannot read property
'maybeRequestFilesystemCredentials' of undefined
}}}
This is located in the `installTheme` function in `wp-admin/js/customize-
controls.js` at line 2155. Tracing the `undefined` state of `wp.updates`
back, brings us to the `enqueue_control_scripts()` method of the
`WP_Customize_Manager` class. Here the updates script is only enqueued
when `! is_multisite()`. For whatever historical reason, this prevents
theme installing on Multisite installs. I am not aware of the origin
behind this, but removing that conditional fixes the issue.
=== After the fix ===
When this would be fixed, installing themes in a multisite subsite
context, generates a situation where the installed theme would not yet be
available for that subsite (try install/preview). This results in a `The
requested theme does not exist.` error of the `wp_die()` kind. This
follows the logic of themes having to be network activated or assigned to
the specific subsite. Please consider a nice way to deal with this
situation or at least generate a more user-friendly error which keeps the
user in the Customizer.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38455>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list