#7213 closed defect (bug) (fixed)
Action "bp_notification_before_save" gets wrong argument
| Reported by: | wordpressrene | Owned by: | djpaul |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.7 |
| Component: | Toolbar & Notifications | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The action "bp_notification_before_save" in the class "BP_Notifications_Notification" in the function "save()" pass the wrong parameter. The data of the notification ($this) is saved in the variable $data before the action. Then the action is called with the parameter $this. After that the notification is stored in the database with the values of $data. So you can't change the data before saving.
Attachments (1)
Change History (5)
#2
@
10 years ago
- Milestone Awaiting Review → 2.7
Yes, good find. I'll move the declaration of $data because I think these filters are intended to filter the current object, not the data being saved.
#4
@
10 years ago
Thank you also @wordpressrene for letting us know, I think this is your first BuddyPress contribution! :)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I forgot something: to fix this Bug, you just have to change
array( &$this )intoarray( &$data )or alternativly you can move the action before the declaration ofarray( $data ).