Skip to:
Content

BuddyPress.org

Changeset 7686


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)

Location:
trunk/bp-notifications
Files:
2 edited

Legend:

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

    r7550 r7686  
    554554            'item_id'           => false,
    555555            'secondary_item_id' => false,
    556             'component_name'    => false,
     556            'component_name'    => array_keys( buddypress()->active_components ),
    557557            'component_action'  => false,
    558558            'is_new'            => true,
  • 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.