WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#24017 closed defect (bug) (invalid)

Network admin sites list page displaying bad links for Dashboard and Visits

Reported by: morriswanchuk Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Multisite Keywords:
Focuses: Cc:

Description

After upgrading to 3.5.1 (from 3.5), we noticed that the links to Dashboard and Visits in the/wp-admin/network/sites.php weren't working properly.

For subsites, the Dashboard link pointed back to the root site, and the same for the Visits link.

I traced the code to the following file: /wp-admin/includes/class-wp-ms-sites-list-table.php.

Line 251 currently is:

$actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id']
     ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';

Adding the $blogname variable to the get_admin_url function as the second parameter fixed the issue:

$actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id']
    , $blogname ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';

Similarly for the Visits link.

Line 272 currently is:

$actions['visit']   = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/
    ' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';

Changing it to the following fixes it:

$actions['visit']   = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], $blogn
ame ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';

Change History (5)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Multisite

Could not reproduce on a clean 3.5.1 install in subdirectory mode.

The Dashboard and Visit links for a subsite correctly point to http://releases.wordpress/ms-3.5.1/site1/wp-admin/ and http://releases.wordpress/ms-3.5.1/site1/, respectively.

#2 @morriswanchuk
5 years ago

OK, not sure what's going on. I have some other issue, maybe related to caching. In particular, the following code returns the root blog url, no matter what blog id I pass to it:

switch_to_blog(16); //blog has option siteurl => "blog1"

echo get_option('siteurl'); // output != "blog1"

Sorry for the false report...I'll keep digging.

#3 @SergeyBiryukov
5 years ago

  • Keywords reporter-feedback added

Have you tested with all plugins disabled?

#4 @Ipstenu
5 years ago

  • Keywords reporter-feedback removed
  • Resolution set to invalid
  • Status changed from new to closed

#5 @markoheijnen
5 years ago

  • Milestone Awaiting Review deleted

Clearing out the milestones for closed tickets on Awaiting Review

Note: See TracTickets for help on using tickets.