Opened 12 years ago
Closed 11 years ago
#5059 closed defect (bug) (fixed)
Notification message close no working
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 1.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Toolbar & Notifications | Keywords: | reporter-feedback |
Cc: |
Description
notification message close no working for my site:
wordpress 3.5.1
buddypress 1.7
solution that i found:
in file: buddypress\bp-meesages\bp-messages-template.php
line:
$closed_notices = bp_get_user_meta( $userdata, 'closed_notices', true );
change to :
$closed_notices = bp_get_user_meta( get_current_user_id(), 'closed_notices', true );
Change History (5)
#2
@
12 years ago
i use custom usermeta and it returned my custom usermeta value not userid,so i change it to get_current_user_id(), it's way better to use get_current_user_id here for conflicts.
#3
@
12 years ago
it's way better to use get_current_user_id here
That may be true, but I'm still struggling to understand your bug. Are you saying that your plugin replaces user IDs in the $userdata global? Is this what you mean by "my custom usermeta value"? If so, that seems like an unsafe thing to be doing. If not, then it's possible that there is a bug elsewhere that should be addressed - $usermeta->ID
should not contain custom usermeta data.
#4
@
12 years ago
- Milestone changed from Awaiting Review to 1.9
$userdata should be fine here. That global is set in setup_userdata(), from inside wp_set_current_user(), meaning the ID is practically copied from one global to another. Using get_current_user_id() would also be fine here, but like Boone, I do not understand the nature of this bug.
Moving to 1.9, since this isn't a regression, and there's not enough information to warrant changing this late in 1.8 beta.
Can you check that line again? https://buddypress.trac.wordpress.org/browser/tags/1.7/bp-messages/bp-messages-template.php#L595 (BP 1.7) shows that we're using
$userdata->ID
, which should return the same value asget_current_user_id()
in all cases that I can think of.