Opened 13 years ago
Closed 13 years ago
#3672 closed defect (bug) (fixed)
Changed email address on user settings is not reflected on next pageload
Reported by: | boonebgorges | Owned by: | |
---|---|---|---|
Milestone: | 1.6 | Priority: | normal |
Severity: | minor | Version: | 1.5 |
Component: | Settings | Keywords: | dev-feedback |
Cc: |
Description
When you change email address via the Settings subsection of the profile, the new address is properly saved, but the *old* address displays on the first subsequent page load. (In other words, if you navigate away from the Settings page, and then return, you will see the new address.)
I assume that what's happening has to do with WP or BP caching, and the fact that we are not redirecting after the settings are saved. Thus, when you submit a change, your POST goes to /members/boone/settings/general/; bp_core_screen_general_settings() catches and sees that you have submitted a change; it saves the change and immediately loads the template. WP loads your usermeta early in this process (actually, early in the setup_globals process, I think), and that data is not reset before the template is loaded, despite the fact that it's been modified in the database.
Two options:
1) Bust the cache on save, probably by reaching directly into $bp->displayed_user
2) Redirect after the save, so the issue doesn't arise in the first place.
The second option is more complicated. Ideally, it would involve breaking the settings save out of the screen function and putting it into its own action function. But it seems more in keeping with what we do elsewhere in BP, and it has the side benefit of not resubmitting on browser refreshes.
The easiest way to remedy this ticket is to change line 85 in bp_core_screen_general_settings() (as of r5301) from:
to:
Sorry for the lack of a patch! If you want one, let me know!