Skip to:
Content

BuddyPress.org

Ticket #5820: 5820.patch

File 5820.patch, 1.6 KB (added by imath, 10 years ago)
  • src/bp-core/admin/bp-core-functions.php

    diff --git src/bp-core/admin/bp-core-functions.php src/bp-core/admin/bp-core-functions.php
    index fc27178..2949006 100644
    function bp_core_activation_notice() { 
    285285                $notice    = sprintf( __( 'The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href="%1$s">Repair</a>', 'buddypress' ), $admin_url, '<strong>' . implode( '</strong>, <strong>', $orphaned_components ) . '</strong>' );
    286286
    287287                bp_core_add_admin_notice( $notice );
     288        } else {
     289                /**
     290                 * Display a notice to inform the Super Admin, he needs to use the repair
     291                 * tool to record existing blogs.
     292                 */
     293                if ( bp_is_active( 'blogs' ) ) {
     294                        $is_root_recorded = BP_Blogs_Blog::is_recorded( bp_get_root_blog_id() );
     295
     296                        if ( empty( $is_root_recorded ) ) {
     297                                $optional_components   = bp_core_admin_get_components( 'optional' );
     298                                $blogs_component_title = $optional_components[ $bp->blogs->id ]['title'];
     299                                $admin_tool_url        = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), 'admin.php' ) ) . '#bp-blog-records';
     300                                $admin_tool_notice     = sprintf( __( 'The %1$s component is almost ready: to register your existing blogs, please use the <a href="%2$s" title="Repopulate blogs records">repair tool</a>.', 'buddypress' ), $blogs_component_title, $admin_tool_url );
     301                               
     302                                bp_core_add_admin_notice( $admin_tool_notice );
     303                        }
     304                }
    288305        }
    289306
    290307        // BP components cannot share a single WP page. Check for duplicate assignments, and post a message if found.