Question about activity arguments override in 2.2.0
-
Hello,
I’m using the mentions feature in buddypress to let users post on other users activity stream. I’m using the plugin bp-activity-as-wire plus some snippet of code that I found online. that snippet of code makes the mentions appear in the user’s activity stream (the user who has been mentioned).
Inside bp-activity-classes.php in the get_filter_sql() function. I replaced:
if ( !empty( $filter_array['user_id'] ) ) { $user_sql = BP_Activity_Activity::get_in_operator_sql( 'a.user_id', $filter_array['user_id'] ); if ( !empty( $user_sql ) ) $filter_sql[] = $user_sql;
With this code:
if ( !empty( $filter_array['user_id'] ) ) { $user_sql = BP_Activity_Activity::get_in_operator_sql( 'a.user_id', $filter_array['user_id'] ); // START Also include @Mentions in User Stream $search_terms = '@'.bp_core_get_username($filter_array['user_id']). '</span>'; $user_sql.= "OR ( a.content LIKE '%%".like_escape($search_terms)."%%' )"; // END Also include @Mentions in User Stream if ( !empty( $user_sql ) ) $filter_sql[] = $user_sql;
It worked perfectly until the last update (2.2.0).
I can see that there is a new method get_scope_query_sql() which overrides activity arguments. When I comment out the function call inside get() everything is working.
My question is what might happen if I leave that function call commented out? Is it going to break anything on my site? I can’t upgrade to 2.2.0 without fixing this issue first.
- The topic ‘Question about activity arguments override in 2.2.0’ is closed to new replies.