#2361 closed defect (bug) (fixed)
Posting reports missing table error wp_bp_user_blogs_blogmeta
Reported by: | ianhaycox | Owned by: | DJPaul |
---|---|---|---|
Milestone: | 1.2.4 | Priority: | major |
Severity: | Version: | ||
Component: | Core | Keywords: | has-patch, needs-testing |
Cc: | ianhaycox |
Description
Wordpress 2.9.1, Buddypress plugin 1.2.3 Default theme.
Create/update a post and the error
WordPress database error: [Table 'worldcup.wp_bp_user_blogs_blogmeta' doesn't exist]
SELECT * FROM wp_bp_user_blogs_blogmeta WHERE blog_id = 1 AND meta_key = 'last_activity'
WordPress database error: [Table 'worldcup.wp_bp_user_blogs_blogmeta' doesn't exist]
INSERT INTO wp_bp_user_blogs_blogmeta ( blog_id, meta_key, meta_value ) VALUES ( 1, 'last_activity', '2010-04-30 22:40:40' )
Warning: Cannot modify header information - headers already sent by (output started at /home/ian/Projects/world-cup-predictor/wp-includes/wp-db.php:615) in /home/ian/Projects/world-cup-predictor/wp-includes/pluggable.php on line 868
is displayed. This is not a multi-site installation and the table wp_bp_user_blogs_blogmeta was not created. This may or may not be correct. I don't know.
However, the problem highlighted itself because normally this fails silently, however installing a plugin with the call
$wpdb->show_errors();
in the main plugin file, or class constructor, makes buddypress report the error and prevents posting.
Ian.
Attachments (1)
Change History (11)
#5
@
15 years ago
- Keywords has-patch needs-testing added
This is an interesting problem; the DB tables aren't included because of a MS check, which the attached patch removes. This is because BP on a non-MS install will still track things like "new blog post, "new comment"; the error is caused when trying to update blogmeta such as 'last_activity'.
The site admin can't choose to disable the blogs component on non-MS, but it's always included.
The last_activity, name and description fields are only used AFAIK on the blogs directory (which is disabled on non-MS installs). As the register existing blogs function isn't called on non-MS, name and description blogmeta of the main blog aren't created. Every new post will update the last_activity timestamp; I don't think one redundant option is overkill.
We need these tables in the DB to avoid errors and what we need to do also is to handle is calling register existing blogs after a WP 3.0 has enabled MS post-install.
#7
@
15 years ago
Instead of creating the tables when we don't need them, we can just move the last_activity update calls so they don't run when on a non-multisite install.
See http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/wordpress-database-error/#post-51754