Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/09/2015 06:47:34 PM (10 years ago)
Author:
r-a-y
Message:

Activity: Scopes with no generated SQL statement should match nothing.

Commit also adds unit tests demonstrating the problem.

Props imath.

Fixes #6099.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-classes.php

    r9325 r9330  
    349349            $scope_query = self::get_scope_query_sql( $r['scope'], $r );
    350350
     351            // Add our SQL conditions if matches were found
    351352            if ( ! empty( $scope_query['sql'] ) ) {
    352353                $where_conditions['scope_query_sql'] = $scope_query['sql'];
     354
     355            // No matches, so we should alter the SQL statement to match nothing
     356            } else {
     357                $where_conditions['scope_no_results'] = '0 = 1';
    353358            }
    354359
Note: See TracChangeset for help on using the changeset viewer.