Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42420 closed defect (bug) (fixed)

Links in file lists in theme/plugin editors don't work in network admin

Reported by: westonruter's profile westonruter Owned by: obenland's profile obenland
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.9
Component: General Keywords: has-patch dev-feedback
Focuses: multisite Cc:

Description

On multisite, clicking on a link in the theme/plugin file trees results in the default file for the theme or plugin to always be loaded. The reason for this is that in 4.9 the admin_url() function is being used and so when the user visits /wp-admin/theme-editor.php?... they get redirected to the network admin but without the query params.

Introduced in [41721] for #24048.

Reported by @obenland in https://wordpress.slack.com/archives/C0381N237/p1509639301000776

Video of issue: https://wordpress.slack.com/files/U02RPUBDZ/F7TBQSNTA/multisite-editors.mov

Attachments (2)

42420.0.diff (900 bytes) - added by westonruter 7 years ago.
42420.diff (804 bytes) - added by flixos90 7 years ago.

Download all attachments as: .zip

Change History (8)

@westonruter
7 years ago

#1 @westonruter
7 years ago

  • Keywords has-patch dev-feedback added
  • Owner set to obenland
  • Status changed from new to reviewing

4.8.3 just has theme-editor.php?… as the URL without any path: https://github.com/WordPress/wordpress-develop/blob/32f78b0ff7c10654058f5572917548253c6492fc/src/wp-admin/theme-editor.php#L246

Whereas in 4.9 there is the wp_print_theme_file_tree() function which does admin_url( 'theme-editor.php' ): https://github.com/WordPress/wordpress-develop/blob/d6aece2a336225e239798e99f163b30e2e9d8874/src/wp-admin/includes/misc.php#L336

42420.0.diff merely replaces admin_url( 'theme-editor.php' ) with theme-editor.php, and similarly for the plugin editor.

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


7 years ago

@flixos90
7 years ago

#3 @flixos90
7 years ago

I'd suggest going with self_admin_url() which will ensure the correct admin URL is used. I used that in 42420.diff.

#4 @obenland
7 years ago

I like @flixos90 approach in 42420.diff. 👍

#5 @westonruter
7 years ago

I do too. @obenland commit?

#6 @obenland
7 years ago

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

In 42115:

File Editors: Account for network admin use

Fixes a bug where files couldn't be accessed in multisite installs.

Props flixos90, westonruter.
Fixes #42420.

Note: See TracTickets for help on using tickets.