Skip to:
Content

BuddyPress.org

Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#8127 closed defect (bug) (fixed)

Possible DB error during BP 5.0.0 upgrade

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

Description

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 15 months ago.

Download all attachments as: .zip

Change History (5)

@imath
15 months ago

#1 @johnjamesjacoby
15 months 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
15 months 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
15 months 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
15 months 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.