#2665 closed defect (bug) (fixed)
bbp_format_buddypress_notifications doesn't return $action when $action !== 'bbp_new_reply'
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.6 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Extend - BuddyPress | Keywords: | has-patch |
| Cc: |
Description
The function bbp_format_buddypress_notifications() is hooked into the filter bp_notifications_get_notifications_for_user. If $action === 'bbp_new_reply', the function will return a proper value. But if $action !== 'bbp_new_reply', it doesn't return anything.
This causes an issue if you have a custom notification action you're trying to format the notification description for:
- If you hook in before
bbp_format_buddypress_notifications()runs,bbp_format_buddypress_notifications()will end up killing your value. - If you hook in after
bbp_format_buddypress_notifications(),$actionwill be null becausebbp_format_buddypress_notifications()doesn't return anything.
The solution is just to add return $action at the end of the function. I'd include a patch, but I'm having trouble finding the proper documentation to do that.
You can view the function here: https://bbpress.trac.wordpress.org/browser/trunk/src/includes/extend/buddypress/notifications.php#L41
Thanks,
Faison
Attachments (1)
Change History (6)
#2
@
11 years ago
- Keywords has-patch added; needs-patch removed
Hi netweb,
Thanks for the links! I don't know why, but I just couldn't find that SVN repo url.
Anyways, I attached a patch that does exactly what I stated above: adds return $action; to the bottom of the function.
Thanks,
Faison
#3
@
11 years ago
- Owner set to johnjamesjacoby
- Resolution set to fixed
- Status changed from new to closed
In 5512:
Thanks for the ticket, do want to create the patch? If so here are some bits to help get started :)
To get started and learn about how to create a patch that is in the format we use here (and the entire WordPress Trac ecosystem) here are a couple of docs to get you on your way:
The bbPress SVN repo is http://bbpress.svn.wordpress.org/trunk