Some blogmeta keys appear multiple times for a given site
While investigating another ticket, I noticed that certain blogmeta keys are often duplicated for a given blog. In particular, it seems limited to the following keys, which mirror WP site settings: description, site_icon_url_full, site_icon_url_thumb, comment_moderation, close_comments_for_old_posts, and a few instances of 'url'.
These settings are mirrored by BP using the
bp_blogs_update_blogmeta() function, which should theoretically check for duplicates. The overwhelming majority of the duplicates have a falsey value - 0 or an empty string - which leads me to believe that a loose check (
! $value or something like that) is to blame.
There's a very small handful of non-falsey duplicates, which must be caused in a different way.
I'll spend a few minutes to see if I can uncover whether this is a BP bug, and then I'll write a script that cleans up the duplicates.
#1 Updated by Boone Gorges almost 2 years ago
I'm attaching a script for deduplicating blogmeta, which has been run on the Commons. (A backup of this table before the script is in my home directory.)
I'll spend time in the next couple weeks looking into the source of the issue. Ray, any ideas in the interim would be welcome.