Skip to:

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2361 closed defect (bug) (fixed)

Posting reports missing table error wp_bp_user_blogs_blogmeta

Reported by: ianhaycox's profile ianhaycox Owned by: djpaul's profile DJPaul
Milestone: 1.2.4 Priority: major
Severity: Version:
Component: Core Keywords: has-patch, needs-testing
Cc: ianhaycox


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


in the main plugin file, or class constructor, makes buddypress report the error and prevents posting.


Attachments (1)

2361-1.patch (577 bytes) - added by DJPaul 14 years ago.

Download all attachments as: .zip

Change History (11)

#2 @ianhaycox
14 years ago

  • Cc ianhaycox added

#3 @ianhaycox
14 years ago

  • Milestone changed from 1.3 to 1.2.4

#4 @DJPaul
14 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

#5 @DJPaul
14 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.

14 years ago

#6 @apeatling
14 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [2985]) Fixes #2361

#7 @apeatling
14 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.

#8 @DJPaul
14 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The call is still inside the !bp_core_is_multisite() check so it could execute on a non-MS install.

#9 @apeatling
14 years ago

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

Fixed in r2988

#10 @ianhaycox
14 years ago

Thank you for the swift resolution.

Note: See TracTickets for help on using tickets.