#4139 closed defect (bug) (fixed)
bp_core_get_root_options() overwriting blog options on certain setups
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.6 | Priority: | normal |
Severity: | major | Version: | |
Component: | Core | Keywords: | |
Cc: |
Description
bp_core_get_root_options() was recently refactored (see https://buddypress.trac.wordpress.org/changeset/4587, https://buddypress.trac.wordpress.org/ticket/3313) to be better at migration when changing settings. However, the logic for migrating these settings was a bit greedy: if even a single option is found missing in the current root_blog's options table, then *all* of the options get copied over from a previous location (sitemeta, etc).
This has the side effect that some changes are perpetually overwritten. As an example, I discovered this issue in the process of troubleshooting an issue with bp-xprofile-fullname-field-name
- I kept changing the name of the field itself in the Dashboard, but the option bp-xprofile-fullname-field-name
kept sticking to an old value.
I'm going to commit a fix that takes the following strategy: in cases where the relevant options are found on the current root_blog, keep them - only attempt to migrate *missing* settings.
(In [5976]) When auto-migrating options in bp_core_get_root_options(), don't overwrite option values that are found on the first pass. Fixes #4139