Skip to:
Content

BuddyPress.org

Ticket #8642: 8642.diff

File 8642.diff, 1.6 KB (added by oztaser, 3 years ago)
  • src/bp-notifications/bp-notifications-cache.php

    diff --git src/bp-notifications/bp-notifications-cache.php src/bp-notifications/bp-notifications-cache.php
    index 38abcfdc3..4f91acc2d 100644
    function bp_notifications_clear_all_for_user_cache_before_update( $update_args, 
    104104
    105105                // Get the list of user IDs from notification IDs.
    106106        } elseif ( isset( $where_args['ids'] ) && $where_args['ids'] ) {
    107                 $ids = (array) $where_args['ids'];
     107                $_where_args       = $where_args['data'];
     108                $_where_args['id'] = $where_args['ids'];
    108109
    109                 $ns = BP_Notifications_Notification::get(
    110                         array(
    111                                 'id' => $ids,
    112                         )
    113                 );
     110                $ns = BP_Notifications_Notification::get( $_where_args );
    114111
    115112                $user_ids = wp_list_pluck( $ns, 'user_id' );
    116113                $user_ids = array_unique( $user_ids );
  • src/bp-notifications/bp-notifications-functions.php

    diff --git src/bp-notifications/bp-notifications-functions.php src/bp-notifications/bp-notifications-functions.php
    index 0fa90341c..74ea32914 100644
    function bp_notifications_mark_notifications_by_item_ids( $user_id, $item_ids, $ 
    639639                        'is_new' => $is_new,
    640640                ),
    641641                array(
     642                        'is_new'           => ! $is_new,
    642643                        'user_id'          => $user_id,
    643644                        'component_name'   => $component_name,
    644645                        'component_action' => $component_action
    function bp_notifications_mark_notifications_by_ids( $ids, $is_new = false ) { 
    661662                $ids,
    662663                array(
    663664                        'is_new' => $is_new,
     665                ),
     666                array(
     667                        'is_new' => ! $is_new
    664668                )
    665669        );
    666670}