Opened 6 years ago
Closed 6 years ago
#44747 closed defect (bug) (wontfix)
Try Gutenberg callout redirects to invalid page on multisite after activation
Reported by: | earnjam | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.8 |
Component: | Administration | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
On a multisite network, if you click on the "Activate Gutenberg" button on the Try Gutenberg callout, it uses self_admin_url( 'plugins.php?action=activate&plugin=gutenberg/gutenberg.php&from=try-gutenberg' )
as the URL to activate the plugin.
This network activates Gutenberg, which is probably fine, but it should maybe be more obvious that's what is happening.
However, after activation, we do a redirect using wp_redirect( self_admin_url( "admin.php?page=gutenberg" ) )
. Since we just activated in the network context, this results in the URL being: /wp-admin/network/admin.php?page=gutenberg
, which does not exist. The user sees a "Sorry, you are not allowed to access this page." error message.
We should use admin_url()
here so it redirects to the demo page on the primary site, rather than trying to be in the network admin.
Use admin_url() instead of self_admin_url() on the redirect