WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11965 closed defect (bug) (wontfix)

Constant BLOGID_CURRENT_SITE not working

Reported by: edir Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9.1
Component: General Keywords: wpmu
Focuses: Cc:

Description

When I tried to set the constant BLOGID_CURRENT_SITE, it didn't work and I found in the script a missing thing. This was the patch I did to make it work.

WPMU 2.9.1.1

wpmu-settings.php:137
+ if( $path == '/' )
+ $path = $wpdb->get_var( $wpdb->prepare("SELECT path FROM $wpdb->blogs WHERE blog_id = %d", BLOGID_CURRENT_SITE) );

Change History (5)

comment:1 edir4 years ago

Resposting the patch. Sorry X)

wpmu-settings.php:137
+	if( $path == '/' )
+		$path = $wpdb->get_var( $wpdb->prepare("SELECT path FROM $wpdb->blogs WHERE blog_id = %d", BLOGID_CURRENT_SITE) );

comment:2 wpmuguru4 years ago

  • Resolution set to invalid
  • Status changed from new to closed

You have to define DOMAIN_CURRENT_SITE and PATH_CURRENT_SITE for BLOGID_CURRENT_SITE to be used.

Those constants are used to bypass the site lookup and eliminate a few database queries on most MU installs.

comment:3 edir4 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Sorry to re-open, but I tested at many ways and it never works, even on a clean instalation os MU.

My installation is using directories for the blogs, instead of sub-domains.

The blogs:

ID 1 => /
ID 5 => /myblog/

The config:

define('DOMAIN_CURRENT_SITE', 'www.domain.com/' );
define('PATH_CURRENT_SITE', '/' );
define('SITE_ID_CURRENT_SITE', 1);
define('BLOGID_CURRENT_SITE', 5);

I don´t need to change DOMAIN_CURRENT_SITE, nothing happen when I change.

The PATH_CURRENT_SITE I can´t use like "/myblog/" because it affects the access of all over the other blogs. It points the path to "www.domain.com/myblog/otherblog" instead of "www.domain.com/otherblog"

comment:4 wpmuguru4 years ago

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

"Those constants are used to bypass the site lookup and eliminate a few database queries on most MU installs."

They are not for creating custom configurations and are not intended to be changed after installation.

comment:5 nacin4 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.