Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/17/2013 05:37:08 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Notifications:

Make buddypress()->active_components the default value for the component_name argument.

This is necessary because notifications are persistent in the database, and active components register callbacks for generating output based on the queried results. If notifications exist for components that are inactive, no callback will be registered, and the output will be empty. By only querying for active components, we can be sure no empty notifications will be displayed to the user.

Reverts r7677. See #5290. Fixes #5300. (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-notifications/bp-notifications-functions.php

    r7677 r7686  
    124124    $bp                    = buddypress();
    125125    $notifications         = BP_Notifications_Notification::get( array(
    126         'user_id'        => $user_id,
    127         'component_name' => array_keys( $bp->active_components ),
     126        'user_id' => $user_id
    128127    ) );
    129128    $grouped_notifications = array(); // Notification groups
Note: See TracChangeset for help on using the changeset viewer.