Skip to:
Content

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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)

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

Download all attachments as: .zip

Change History (11)

comment:2 ianhaycox4 years ago

  • Cc ianhaycox added

comment:3 ianhaycox4 years ago

  • Milestone changed from 1.3 to 1.2.4

comment:4 DJPaul4 years ago

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

comment:5 DJPaul4 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.

DJPaul4 years ago

comment:6 apeatling4 years ago

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

(In [2985]) Fixes #2361

comment:7 apeatling4 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.

comment:8 DJPaul4 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.

comment:9 apeatling4 years ago

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

Fixed in r2988

comment:10 ianhaycox4 years ago

Thank you for the swift resolution.

Note: See TracTickets for help on using tickets.