Skip to:

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8127 closed defect (bug) (fixed)

Possible DB error during BP 5.0.0 upgrade

Reported by: imath's profile imath Owned by: dcavins's profile dcavins
Milestone: 5.0.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch


In [12429] was introduced the function to migrate existing "old" group invites into the new way of managing the Group Invites, see bp_groups_migrate_invitations(). This works fine, unless there are no invites to migrate 😬. In this case we get a DB error.

@dcavins could you review the patch and take this ticket in charge?

Attachments (1)

8127.patch (575 bytes) - added by imath 5 years ago.

Download all attachments as: .zip

Change History (5)

5 years ago

#1 @johnjamesjacoby
5 years ago


Should be empty( $records ) instead of ! to avoid type juggling.

(It is checking for a non-empty result, but get_results() returns array|object|null – not a boolean.)

Cleaning all of those up could probably it's own issue at this point though, so I'm OK with either.

#2 @dcavins
5 years ago

  • Owner set to dcavins
  • Resolution set to fixed
  • Status changed from new to closed

In 12445:

Invitations: Stop migration if no invitations are found.

If no invitations are found in the group invitations migration routine, stop the migration.

Props imath.

Fixes #8127.

#3 @dcavins
5 years ago

In 12446:

Invitations: Improve migration logic.

Per jjj: "Should be empty( $records ) instead of ! to avoid type juggling."

Props jjj.

See #8127.

#4 @dcavins
5 years ago

Thanks @jjj and @imath! I had to do some work to expose the error, but the patch resolved it as expected.

Thanks again!

Note: See TracTickets for help on using tickets.