Add some basic unit tests for root_profiles routing. See #4954

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7892 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Introduce bp_add_option() function.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7893 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add update_meta_cache param for BP_Groups_Group stack

This allows us to avoid unneeded meta cache pre-fetching, following WP_Query.

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7894 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't update_meta_cache when querying for groups in activity post form box.

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7895 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r7895

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7896 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Normalize whitespace in bp_has_groups() parameter stack

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7897 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Introduce $args param to BP_Groups_Group constructor and groups_get_group()

This argument array can contain the following toggles:
- update_meta_cache (pre-fetch all group metadata for the queried group)
- populate_extras (pre-fetch last activity, admin/mod lists, and current user
  access/membership status in queried group)

Both items default to false, for backward compatibility

Allowing these pre-fetch toggles to be set to false allows us to avoid large
numbers of unnecessary database queries in certain cases, such as when
secondary avatars are populated on activity directories.

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7898 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
When fetching the group in bp_get_activity_secondary_avatar(), don't get group extras

We have no need for membership info, etc, so we avoid a number of queries here.

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7899 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r7899

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7900 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't prime activitymeta cache in BP_Activity_Activity::construct()

bp_activity_get_meta() now uses the core API functions. get_metadata() works by
priming the cache with *all* object metadata when requesting any piece of
metadata for that object. This means that, instead of pre-fetching activitymeta
when instantiating BP_Activity_Activity, we wait until it happens in
get_metadata(). At best, this can help us to avoid pre-fetching a meta cache
that will not be used.

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7901 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r7901

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7902 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't prime groupmeta cache in BP_Groups_Group::__construct()

groups_get_groupmeta() now uses the core API functions. get_metadata() works by
priming the cache with *all* object metadata when requesting any piece of
metadata for that object. This means that, instead of pre-fetching groupmeta
when instantiating BP_Groups_Group, we wait until it happens in get_metadata().
At best, this can help us to avoid pre-fetching a meta cache that will not be
used.

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7903 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Install default options at installation time and at upgrade to 2.0

When BuddyPress is installed, all basic config options should be saved to the
database, even when the setting is empty (0). This ensures that the options
will be pre-fetched by the first call to wp_load_alloptions() and stored in the
non-persistent cache, removing the necessity to make additional failed queries
to the wp_options table.

This changeset also includes logic to add missing default options to existing
default installations when upgrading to 2.0.

Fixes #5385

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7904 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Introduce 'update_meta_cache' param to bp_has_activities() stack

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7905 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Whitespace and codestyling in bp-activity

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7906 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Fix phpdoc for bp_activity_update_meta_cache

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7907 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r7907

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7908 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Tests: Always fetch directory pages when using go_to() method.

This ensures that BP's directory pages are always fetched to further
ensure that the go_to() method emulates a regular BP page bootstrap.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7909 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add unit test to check bp_core_get_user_domain() after changing the
members directory page slug.

See #5402.

Props boonebgorges.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7910 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Remove object cache for bp_core_get_user_domain() function.

This caused issues when using a persistent object cache and when the
members directory page slug was changed in the admin area.

Because bp_core_get_user_domain() has its own object cache that is
keyed to each individual user, cache invalidation becomes troublesome.

Since we are already caching the username, this makes caching the
user domain redundant.  Thus, this commit removes the object
cache associated with the bp_core_get_user_domain() function, while
leaving the 'bp_core_get_user_domain_pre_cache' filter in place for
backwards compatibility.

Fixes #5402.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7911 cdf35c40-ae34-48e0-9cc9-0c9da1808c22