Hi,
Rich, the developer of the e-commerce plugin eShop has been working hard - with a little help from me and Mattz - to make his plugin compatible with WP_MU. Read more on http://www.quirm.net/page.php?id=39 and but do not use that (stable) version as it is for WP only... He intends to make the new version publicly available as soon as it works fine. So if anybody cares to join the effort? Testers wanted :-)
The latest beta (really an alpha at this point) can be found on http://www.quirm.net/punbb/viewtopic.php?id=148&p=6#p969 (for testing purposes only !! read on...)
I have the impression we are nearly there, except for one SERIOUS problem. As Rich is not familiar with WP_MU, I have tried to explain as simple as I could what is going wrong on http://www.quirm.net/punbb/viewtopic.php?id=148&p=6#p967 but I will try to be more informative below.
I hope some of the guru's on this forum can shed some light on this issue.
REPRODUCING
1. On a clean install of WP_MU 1.3.3 (in my case subdirectories, not subdomains) upload eShop beta to the /plugins/ directory.
2. Activate it on the main blog
3. Go to Site Admin > Blogs and create a new blog at the bottom
WHAT HAPPENS?
On my setup, the database tables for the new blog are not created.
In my log files I see (abbreviated the last log entries):
WordPress database error: [Table
'wpmu_test.wp_2_posts' doesn't exist]\nSELECT * FROM wp_2_posts\n,
referer: http://free-jazz.net/wordpress-mu-1.3.3/wp-admin/wpmu-blogs.php
install_blog - ID: 2 URL: http://free-jazz.net/wordpress-mu-1.3.3/test/
Title: test , referer: http://free-jazz.net/wordpress-mu-1.3.3/wp-admin/wpmu-blogs.php
WordPress database error: [Table
'wpmu_test.wp_2_options' doesn't exist]\n
INSERT INTO wp_2_options (option_name, option_value, autoload) VALUES ('WPLANG', '', 'yes')\n, referer: http://free-jazz.net/wordpress-mu-1.3.3/wp-admin/wpmu-blogs.php
WordPress database error: [Table
'wpmu_test.wp_2_options' doesn't exist] ...
Notice that the first error is from checking whether the new blog tables already exsist. They do not, so this is correct behaviour. Then the second entry shows the install_blog message. But all errors after that are showing that the tables for blog ID 2 have not been created !
To get more info, I have inserted at the end of function make_db_current_silent() (/wp-admin/incluses/upgrade.php starting at line 1062) two lines that create more error logs:
error_log($wp_queries, 0);
foreach($alterations as $alteration) error_log($alteration, 0);
The error log created by that first line clearly shows that the function is attempting to create tables for the main blog, not for the new blog (abbreviated the log entry):
CREATE TABLE wp_1_terms (\n term_id bigint(20) NOT NULL auto_increment,\n name varchar(55) NOT NULL default '',\n slug varchar(200) NOT NULL default '',\n term_group bigint(10) NOT NULL default 0,\n PRIMARY KEY (term_id),\n UNIQUE KEY slug (slug)\n) DEFAULT CHARACTER SET utf8;\nCREATE TABLE wp_1_term_taxonomy [...]
The second line results in :
Changed type of wp_1_posts.post_status from enum('publish','draft','private','static','object', 'attachment','inherit','future','pending') to enum('publish','draft','private','static','object', 'attachment','inherit','future',, referer: http://free-jazz.net/wordpress-mu-1.3.3/wp-admin/wpmu-blogs.php?updated=true&action=add-blog
So what I can figure from this, is that up until the call make_db_current_silent()
from function install_blog in wp-includes/wpmu-functions.php on line 1290 , all goes well (switching to the new blog ID and checking for existence of database tables)... But at that point, when the routine goes to function make_db_current_silent() and from that to function dbDelta() using the global value $wp_queries as input, all falls to pieces...
WHEN DOES IT NOT HAPPEN?
Just disabling the eShop beta plugin, will solve the issue. I am not running any other plugins on my test setup of WP_MU 1.3.3 . So clearly, something in the plugin is causing it.
WHY?
Can it be that the plugin somehow cause the 'old' $wpdb or $wp_queries values from before the function switch_to_blog to get back in the game again? How is this possible ?
Anybody any ideas?
THANKS for helping the first public e-commerce plugin for MU come to live !!
--Allard