Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42674 closed defect (bug) (fixed)

Multisite issue: Customizer display message to add themes to blog to non super admins

Reported by: lenasterg's profile lenasterg Owned by: westonruter's profile westonruter
Milestone: 4.9.3 Priority: normal
Severity: normal Version: 4.9
Component: Customize Keywords: has-patch fixed-major commit
Focuses: multisite Cc:

Description

Hi.
This is a multisite issue.
The Customizer displays message to install themes and link to .../wp-admin/theme-install.php, without checking if the user is a super admin or a simple blog admin.
So the user after clicking the link gets the "Sorry, you are not allowed to install themes on this site." error.

Attachments (1)

42674.diff (1.9 KB) - added by flixos90 7 years ago.

Download all attachments as: .zip

Change History (11)

#1 @lenasterg
7 years ago

  • Summary changed from Mulisite issue: Customizer display message to add themes to blog to non super admins to Multisite issue: Customizer display message to add themes to blog to non super admins

#2 @lenasterg
7 years ago

The js notification with the link to admin_url( 'theme-install.php' ) is the 'themeInstallUnavailable' defined at https://core.trac.wordpress.org/browser/trunk/src/wp-includes/script-loader.php#L599
and is displayed in:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/js/customize-controls.js#L3078

#3 @westonruter
7 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 4.9.2

@flixos90
7 years ago

#4 @flixos90
7 years ago

  • Keywords has-patch added; needs-patch removed

42674.diff adds an additional JS variable that contains whether the current user can install themes. The message is then only shown if they can and if filesystem credentials are needed.

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


7 years ago

#6 @westonruter
7 years ago

  • Owner set to westonruter
  • Status changed from new to reviewing

#7 @dd32
7 years ago

  • Milestone changed from 4.9.2 to 4.9.3

Bumping to 4.9.3 due to 4.9.2s release

#8 @westonruter
7 years ago

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

In 42536:

Customize: Prevent showing SFTP theme installation notification in multisite when user cannot install themes.

Props flixos90.
See #37661, #42184.
Fixes #42674.

#9 @westonruter
7 years ago

  • Keywords fixed-major commit added
  • Resolution fixed deleted
  • Status changed from closed to reopened

#10 @westonruter
7 years ago

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

In 42537:

Customize: Prevent showing SFTP theme installation notification in multisite when user cannot install themes.

Props flixos90.
See #37661, #42184.
Fixes #42674 for 4.9 branch.

Note: See TracTickets for help on using tickets.