Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7146 closed defect (bug) (fixed)

Activity permalink access doesn't work with legacy activity query

Reported by: r-a-y's profile r-a-y Owned by: r-a-y's profile r-a-y
Milestone: 2.6.1 Priority: normal
Severity: normal Version: 2.6.0
Component: Activity Keywords: has-patch
Cc:

Description (last modified by r-a-y)

In #7113, we fixed a bug where anybody's activity item could be displayed under a member profile.

However, due to the strict activity user ID check for the fix, this broke activity permalink access on some installs:
https://buddypress.trac.wordpress.org/browser/tags/2.6.0/src/bp-activity/bp-activity-screens.php?marks=253#L252

$activity->user_id is a string when the older 'bp_use_legacy_activity_query' filter is set to true via a plugin.

#6977 marks ongoing work to cast all our numeric strings as integers. r10853 missed an integer casting instance in the older, legacy activity query, which caused the problem.

Attached patch fixes this up.

Attachments (1)

7146.01.patch (1.3 KB) - added by r-a-y 8 years ago.

Download all attachments as: .zip

Change History (5)

@r-a-y
8 years ago

#1 @r-a-y
8 years ago

  • Description modified (diff)

#3 @r-a-y
8 years ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from new to closed

In 10907:

Activity: Fix issue with activity permalink access when the legacy activity query is enabled.

In #7113, we fixed a bug where anybody's activity item could be displayed
under a member profile. The fix (r10880) does a strict type check on
$activity->user_id.

We expect $activity->user_id to be an integer, however it can be a
numeric string if the legacy activity query is enabled with:
add_filter( 'bp_use_legacy_activity_query', '__return_true' );

Since the check will always fail in this instance, members will not be able
to access activity permalinks.

We unfortunately missed this specific instance in r10853.

This commit addresses this problem.

See #6977. Fixes #7146 (2.6-branch).

#4 @r-a-y
8 years ago

In 10908:

Activity: Fix issue with activity permalink access when the legacy activity query is enabled.

In #7113, we fixed a bug where anybody's activity item could be displayed
under a member profile. The fix (r10880) does a strict type check on
$activity->user_id.

We expect $activity->user_id to be an integer, however it can be a
numeric string if the legacy activity query is enabled with:
add_filter( 'bp_use_legacy_activity_query', '__return_true' );

Since the check will always fail in this instance, members will not be able
to access activity permalinks.

We unfortunately missed this specific instance in r10853.

This commit addresses this problem.

See #6977. Fixes #7146 (trunk).

Note: See TracTickets for help on using tickets.