Skip to:
Content

BuddyPress.org

Changeset 10972


Ignore:
Timestamp:
07/30/2016 12:32:04 PM (8 years ago)
Author:
imath
Message:

Multisite: Make sure the Blogs directory page is dynamically created when activating the component.

Fixes #7150

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r10956 r10972  
    634634        'activity' => _x( 'Activity', 'Page title for the Activity directory.',       'buddypress' ),
    635635        'groups'   => _x( 'Groups',   'Page title for the Groups directory.',         'buddypress' ),
    636         'sites'    => _x( 'Sites',    'Page title for the Sites directory.',          'buddypress' ),
     636        'blogs'    => _x( 'Sites',    'Page title for the Sites directory.',          'buddypress' ),
    637637        'members'  => _x( 'Members',  'Page title for the Members directory.',        'buddypress' ),
    638638        'activate' => _x( 'Activate', 'Page title for the user activation screen.',   'buddypress' ),
     
    658658
    659659    // No need for a Sites directory unless we're on multisite.
    660     if ( ! is_multisite() && isset( $pages_to_create['sites'] ) ) {
    661         unset( $pages_to_create['sites'] );
     660    if ( ! is_multisite() && isset( $pages_to_create['blogs'] ) ) {
     661        unset( $pages_to_create['blogs'] );
    662662    }
    663663
  • trunk/tests/phpunit/testcases/admin/functions.php

    r10941 r10972  
    209209        $missing_pages = array();
    210210        foreach( buddypress()->admin->notices as $notice ) {
     211            if ( false !== strpos( $notice['message'], 'BuddyPress is almost ready' ) ) {
     212                continue;
     213            }
     214
    211215            preg_match_all( '/<strong>(.+?)<\/strong>/', $notice['message'], $missing_pages );
    212216        }
    213217
    214         $this->assertNotContains( 'Register', $missing_pages[1] );
    215         $this->assertNotContains( 'Activate', $missing_pages[1] );
     218        $this->assertEmpty( $missing_pages );
    216219
    217220        // Reset buddypress() vars
  • trunk/tests/phpunit/testcases/core/functions.php

    r10470 r10972  
    722722        $this->assertContains( $link_color, $result );
    723723    }
     724
     725    /**
     726     * @group bp_core_add_page_mappings
     727     */
     728    public function test_bp_core_add_page_mappings() {
     729        $bp = buddypress();
     730        $reset_bp_pages = $bp->pages;
     731
     732        $expected = array( 'activity', 'groups', 'members' );
     733        if ( is_multisite() ) {
     734            $expected = array( 'activity', 'blogs', 'groups', 'members' );
     735        }
     736
     737        bp_core_add_page_mappings( $bp->active_components );
     738        $bp_pages = array_keys( bp_get_option( 'bp-pages' ) );
     739        sort( $bp_pages );
     740
     741        $this->assertEquals( $expected, $bp_pages );
     742
     743        $bp->pages = $reset_bp_pages;
     744    }
    724745}
Note: See TracChangeset for help on using the changeset viewer.