[buddypress-trac] [BuddyPress] #5290: Getting notifications for a user should check for active components
buddypress-trac
noreply at wordpress.org
Thu Dec 12 03:53:35 UTC 2013
#5290: Getting notifications for a user should check for active components
---------------------------+-----------------------------------
Reporter: imath | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Notifications | Version: 1.8.1
Severity: normal | Keywords: has-patch 2nd-opinion
---------------------------+-----------------------------------
I was replying to #5289, and i thought what happens if a component is
deactivated and user has unread notifications for this component ? For
example, i mention a user, then i go into the component settings screen
and deactivate the Activity stream component.
In this case, the notifications are displayed to the user in the WP Admin
Bar, and clicking on the links doesn't mark the notifications as read.
In WP Admin Bar and in the unread tab of the notifications component, the
text displayed is the component_action field of $wpdb->bp_notifications
So the user will have to go in his notifications screen / unread tab to
mark or delete each notifications in order to make the WP Admin Bar bubble
reset to 0.
So i suggest the attached diff in order to build an array of active
components to query on. Even if this array will include components that
will never send notifications, it will take care of unread notifications
created by a plugin in case the plugin has been deactivated.
This means the plugin to use notifications needs to set himself as an
active component, e.g.:
{{{buddypress()->active_components['mypluginid'] = '1';}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5290>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list