Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#6036 closed defect (bug) (no action required)

MySQL Strict Mode

Reported by: imath's profile imath Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords:
Cc:

Description

Since WP changeset 30400 WPDB: Force STRICT_ALL_TABLES. Although i didn't see any warning using BuddyPress so far, i've noticed a test was failing in tests/phpunit/testcases/groups/cache.php : BP_Tests_Group_Cache->test_groups_get_group_admins_cache

The problem in the test is that it's running groups_promote_member() on a user that is not yet a member. So some fields are not set in the db.

As boonebgorges suggested, this ticket can act as a catch-all for fixing our INSERT/UPDATE statements so that they're strict-mode compatible.

For now i'll attach the patch i suggest for the unit test to fix the Database error it's generating.

Attachments (1)

6036.patch (518 bytes) - added by imath 9 years ago.

Download all attachments as: .zip

Change History (9)

@imath
9 years ago

#2 follow-up: @DJPaul
9 years ago

If this unit test is the only thing throwing errors, then fixing it is obviously good. But *if* we are able to trigger genuine SQL errors after #WP30400 through normal use, then: we probably need to do a minor release on the current branch for 4.1 compat; and also comment on that core trac ticket that we've run into the same problem.

But it sounds like we need to do manually test BP on the WP trunk to see if we have a problem. :)

#3 in reply to: ↑ 2 @imath
9 years ago

Replying to DJPaul:

... we probably need to do a minor release on the current branch for 4.1 compat

Yes i agree, so i suggest to wait we are sure there are no impacts before moving forward in #6008.

But i think we should commit the patch on the unit test and leave this ticket open.

#4 @boonebgorges
9 years ago

i think we should commit the patch on the unit test

Yes

i suggest to wait we are sure there are no impacts before moving forward in #6008.

No. If we have to wait on #6008, we have to wait on every ticket. I don't think this is necessary. Let's just keep an eye out and fix specific strict-mode-related issues as they arise, but let's not hold up work on the rest of BuddyPress.

#5 @imath
9 years ago

Sorry for being a "tête de linottes" on my latest comment. I forgot we had 2.1 branch!
I'm goint to commit this ticket's patch and the remove link thing on the other ticket.

Then, i'll begin checking queries.

Last edited 9 years ago by imath (previous) (diff)

#6 @imath
9 years ago

In 9156:

Unit tests: make sure the user is a member of the group before promoting him

WordPress changeset 30400 introduced STRICT_ALL_TABLES in WPDB and revealed a trouble in BP_Tests_Group_Cache->test_groups_get_group_admins_cache. As the user was directly promoted as an admin of the group without being first added as a member, a WordPress database error was making this test fail.
The ticket will remain open in case we find some other notices errors when we use WPDB.

See #6036

#7 @boonebgorges
9 years ago

  • Milestone 2.2 deleted
  • Resolution set to invalid
  • Status changed from new to closed

This was pulled out of WP in [WP30587]. Let's close this ticket and worry about it when/if it's put back.

#8 @DJPaul
8 years ago

  • Component changed from Tools - Warnings/Notices to Core
Note: See TracTickets for help on using tickets.