Skip to:
Content

BuddyPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7848 closed defect (bug) (fixed)

Using the legacy activity query causes notices

Reported by: r-a-y Owned by: r-a-y
Milestone: 3.1.0 Priority: normal
Severity: normal Version: 3.0.0
Component: Activity Keywords: has-patch commit
Cc:

Description

The incremented cache improvements introduced in r11101 (see #7245) causes some notices if the legacy activity query is force-enabled and when the 'count_total' parameter is passed to bp_activity_get().

See https://buddypress.org/support/topic/new-update-white-screen/#post-273276

The problem is due to the $cache_group not being defined in the legacy activity query.

Attachments (1)

7848.01.patch (2.5 KB) - added by r-a-y 4 years ago.

Download all attachments as: .zip

Change History (7)

@r-a-y
4 years ago

#1 @DJPaul
4 years ago

  • Milestone changed from 3.0.1 to 3.1.0

Milestone renamed

#2 @r-a-y
4 years ago

@boonebgorges - Can you take a quick look at this to see if the approach is okay?

#3 @boonebgorges
4 years ago

  • Keywords commit added

If I'm reading the patch correctly, it'll prevent notices because $cache_group will be defined, but the cache will always be empty for these items (unless they're set by another instance of the activity query that is *not* running in legacy mode). Is that right? That seems fine to me - no need to sink time into wrapping caching around these old queries - but I just want to be sure I understand it correctly :)

#4 @r-a-y
4 years ago

You're correct that the main activity DB query would not be cached in legacy mode, but it would cache the activity total count:
https://buddypress.trac.wordpress.org/browser/tags/3.0.0/src/bp-activity/classes/class-bp-activity-activity.php?marks=742,745#L729

I copied the preg_match stuff from r11101, which I believe should also catch legacy queries, but I haven't fully tested.

#5 @r-a-y
4 years ago

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

In 12152:

Activity: After r11101, fix notices when using the legacy activity query.

r11101 introduced incremented cache improvements when fetching activity
items. However, if the legacy activity query is force-enabled and if the
'count_total' parameter is passed, a few notices are thrown due to
the $cache_group variable not being defined.

This commit addresses this by declaring the $cache_group variable during
the legacy activity query block.

See #7245.

Fixes #7848 (3.x branch).

#6 @r-a-y
4 years ago

In 12153:

Activity: After r11101, fix notices when using the legacy activity query.

r11101 introduced incremented cache improvements when fetching activity
items. However, if the legacy activity query is force-enabled and if the
'count_total' parameter is passed, a few notices are thrown due to
the $cache_group variable not being defined.

This commit addresses this by declaring the $cache_group variable during
the legacy activity query block.

Fixes #7848 (trunk).

Note: See TracTickets for help on using tickets.