ivanbajalovic
Forum Replies Created
-
Forum: Networking WordPress
In reply to: WordPress 3.9 Multisite db connection errorIn WordPress 3.8 they set $path like this:
$current_site->path = $path = PATH_CURRENT_SITE;where $current_site is Stdclass object.
In WordPress 3.9 they set $path like this:
$path = strtolower( stripslashes( $_SERVER['REQUEST_URI'] ) ); if ( is_admin() ) { $path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path ); } list( $path ) = explode( '?', $path ); .... $current_site->path = PATH_CURRENT_SITE;In WP 3.9 they set $path based on URL and $current_site->path based on constant PATH_CURRENT_SITE. This is the essence of the problem.
Should this be treated as a bug?
Forum: Networking WordPress
In reply to: WordPress 3.9 Multisite db connection errorThe directory path is OK. This code snippet is just to demonstrate the problem. In production, I did not change controller in Zend FW, I just updated WordPress and the error started to pop out…
I think I found where the problem is. In wp-includes/ms-settings.php on line 56 there is an if statement
if ( $current_site->domain === $domain && $current_site->path === $path )$current_site is Stdclass object, and domain and path attributes are set to (for my above example on localhost): domain => localhost, path => blog39 but the $path variable has value of “testblog” (this is the folder where this test file is located). Because condition is false $current_blog variable is set to null which gives the connection error.
Because the path from where I include wp-load.php does not belong to any multi site that is created, I am getting this error.
Any idea how to find a fix to this? Or the WordPress dev crew did this on purpose?
Forum: Networking WordPress
In reply to: WordPress 3.9 Multisite db connection errorWP 3.9 works properly. I can create new multi site, write post etc.. But when I try to enable any wp feature on my website (by including wp-load.php) I have problem with WP 3.9. The same code works ok with 3.8 version.
As I dug a little deeper it seems like $wpdb is NULL.