Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7440 closed defect (bug) (fixed)

Activity: error using bp_activity_get_actions_for_context() without activity component

Reported by: espellcaste's profile espellcaste Owned by: boonebgorges's profile boonebgorges
Milestone: 2.8 Priority: normal
Severity: major Version:
Component: Core Keywords: has-patch
Cc:

Description

I'm with a problem with BuddyPress Followers not working on profile pages after this change was added: https://buddypress.trac.wordpress.org/changeset/11356

So far I was able to figure it out that it is using a function, bp_activity_get_actions_for_context() , that's only available if the activity component is active. As this particular component is not needed in my community, it is throwing an error.

[08-Feb-2017 12:45:49 UTC] PHP Fatal error: Uncaught Error: Call to undefined function bp_activity_get_actions_for_context() in /srv/www/blog/htdocs/wp-content/plugins/buddypress/src/bp-templates/bp-legacy/buddypress-functions.php:692
Stack trace:
#0 /srv/www/blog/htdocs/wp-includes/class-wp-hook.php(298): bp_legacy_theme_ajax_querystring(, 'members')
#1 /srv/www/blog/htdocs/wp-includes/plugin.php(203): WP_Hook->apply_filters(
, Array)
#2 /srv/www/blog/htdocs/wp-content/plugins/buddypress/src/bp-core/bp-core-template.php(1266): apply_filters('bp_ajax_queryst...', , 'members')
#3 /srv/www/blog/htdocs/wp-content/themes/irb-5.7/buddypress/members/members-loop.php(26): bp_ajax_querystring('members')
#4 /srv/www/blog/htdocs/wp-includes/template.php(687): require('/srv/www/blog/h...')
#5 /srv/www/blog/htdocs/wp-content/plugins/buddypress/src/bp-core/bp-core-template-loader.php(155): load_template('/srv/www/blog/h...', false)
#6 /srv/www/blog/htdocs/wp-content/plugins/buddypress/src/bp-core/bp-core-template-loader.php(61): bp_locate_template(Array, true, in /srv/www/blog/htdocs/wp-content/plugins/buddypress/src/bp-templates/bp-legacy/buddypress-functions.php on line 692

I'm attaching a patch for a quick fix. I presume you guys will decide for a better/new way.

Attachments (1)

activity-error.diff (2.6 KB) - added by espellcaste 8 years ago.

Download all attachments as: .zip

Change History (5)

#1 @Offereins
8 years ago

  • Milestone changed from Awaiting Review to 2.8
  • Summary changed from BP Activity Actions for Content Function Error to Activity: error using bp_activity_get_actions_for_context() without activity component

From the logic in bp_legacy_theme_ajax_querystring() I'd say the cookie check implies that once the cookie exists, the activity component should be active. Though, when the activity component is deactivated again, the cookie'd filter still exists, so the function naturally breaks. A valid bug, I guess.

This ticket was mentioned in Slack in #buddypress by slaffik. View the logs.


8 years ago

#3 @boonebgorges
8 years ago

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

In 11419:

Don't use activity function to filter AJAX querystring when Activity component is disabled.

Introduced in [11356].

Props espellcaste.
Fixes #7440.

#4 @boonebgorges
8 years ago

In 11421:

When parsing directory AJAX querystring, don't skip 'type' param when Activity is disabled.

Introduced in [11419].

Props r-a-y.
See #7440.

Note: See TracTickets for help on using tickets.