#7213 closed defect (bug) (fixed)
Action "bp_notification_before_save" gets wrong argument
Reported by: | wordpressrene | Owned by: | djpaul |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Toolbar & Notifications | 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
@
8 years ago
- Milestone changed from Awaiting Review to 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.
#3
@
8 years ago
- Owner set to djpaul
- Resolution set to fixed
- Status changed from new to closed
In 11015:
#4
@
8 years ago
Thank you also @wordpressrene for letting us know, I think this is your first BuddyPress contribution! :)
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 )
.