#5290 closed defect (bug) (fixed)
Getting notifications for a user should check for active components
Reported by: | imath | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 1.9 | Priority: | normal |
Severity: | normal | Version: | 1.8.1 |
Component: | Toolbar & Notifications | Keywords: | has-patch 2nd-opinion dev-feedback |
Cc: |
Description
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';
Attachments (1)
Change History (8)
#2
in reply to:
↑ 1
@
11 years ago
- Keywords dev-feedback added
Replying to boonebgorges:
Let's look at this for 2.0.
Boone, i'm sorry to insist, but it's a regression. In 1.8.1, if the component is not active, then the notification is not added in the WP Admin Bar. I'm sorry i should have checked in 1.8.1 before :(
see http://buddypress.trac.wordpress.org/browser/tags/1.8.1/bp-members/bp-members-notifications.php#L107
Although risk is very weak that an administrator deactivate a component once his BuddyPress is set, it's there. So maybe 2.0 might be a bit late, what do you think of keeping an eye on this and maybe add it in to a minor version if feedbacks about this trouble are sent by users ?
Let's look at this for 2.0.