Skip to:
Content

BuddyPress.org

Changeset 14050


Ignore:
Timestamp:
10/22/2024 02:16:15 AM (8 months ago)
Author:
imath
Message:

Resolve Multiple Issues with the BuddyPress Constants panel

  • Make sure the BP_XPROFILE_BASE_GROUP_NAME & BP_XPROFILE_FULLNAME_FIELD_NAME are defined before using them
  • Use the right option name to set the BP_XPROFILE_BASE_GROUP_NAME
  • Include BP_EMBED_DISABLE_ACTIVITY into the BuddyPress Constants panel
  • Remove the deprecated mention from BP_FORUMS_PARENT_FORUM_ID, BP_FORUMS_SLUG & BP_SEARCH_SLUG constants.

Props emaralive

Fixes #9245 (branch 14.0)

Location:
branches/14.0/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/14.0/src/bp-core/admin/bp-core-admin-tools.php

    r14040 r14050  
    942942            'BP_XPROFILE_BASE_GROUP_NAME'           => array(
    943943                'label' => 'BP_XPROFILE_BASE_GROUP_NAME',
    944                 'value' => BP_XPROFILE_BASE_GROUP_NAME,
     944                'value' => defined( 'BP_XPROFILE_BASE_GROUP_NAME' ) ? BP_XPROFILE_BASE_GROUP_NAME : __( 'Undefined', 'buddypress' ),
    945945            ),
    946946            'BP_XPROFILE_FULLNAME_FIELD_NAME'       => array(
    947947                'label' => 'BP_XPROFILE_FULLNAME_FIELD_NAME',
    948                 'value' => BP_XPROFILE_FULLNAME_FIELD_NAME,
     948                'value' => defined( 'BP_XPROFILE_FULLNAME_FIELD_NAME' ) ? BP_XPROFILE_FULLNAME_FIELD_NAME : __( 'Undefined', 'buddypress' ),
    949949            ),
    950950            'BP_MESSAGES_AUTOCOMPLETE_ALL'          => array(
     
    962962                'debug' => defined( 'BP_GROUPS_DEFAULT_EXTENSION' ) ? BP_GROUPS_DEFAULT_EXTENSION : 'undefined',
    963963            ),
     964            'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH' => array(
     965                'label' => 'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH',
     966                'value' => defined( 'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH' ) ? BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH : __( 'Undefined', 'buddypress' ),
     967                'debug' => defined( 'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH' ) ? BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH : 'undefined',
     968            ),
     969            'BP_EMBED_DISABLE_PRIVATE_MESSAGES'     => array(
     970                'label' => 'BP_EMBED_DISABLE_PRIVATE_MESSAGES',
     971                'value' => defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) ? BP_EMBED_DISABLE_PRIVATE_MESSAGES : __( 'Undefined', 'buddypress' ),
     972                'debug' => defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) ? BP_EMBED_DISABLE_PRIVATE_MESSAGES : 'undefined',
     973            ),
     974            'BP_EMBED_DISABLE_ACTIVITY'     => array(
     975                'label' => 'BP_EMBED_DISABLE_ACTIVITY',
     976                'value' => defined( 'BP_EMBED_DISABLE_ACTIVITY' ) ? BP_EMBED_DISABLE_ACTIVITY : __( 'Undefined', 'buddypress' ),
     977                'debug' => defined( 'BP_EMBED_DISABLE_ACTIVITY' ) ? BP_EMBED_DISABLE_ACTIVITY : 'undefined',
     978            ),
     979            'BP_EMBED_DISABLE_ACTIVITY_REPLIES'     => array(
     980                'label' => 'BP_EMBED_DISABLE_ACTIVITY_REPLIES',
     981                'value' => defined( 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' ) ? BP_EMBED_DISABLE_ACTIVITY_REPLIES : __( 'Undefined', 'buddypress' ),
     982                'debug' => defined( 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' ) ? BP_EMBED_DISABLE_ACTIVITY_REPLIES : 'undefined',
     983            ),
     984            'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' => array(
     985                'label' => 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE',
     986                'value' => defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) ? BP_ENABLE_USERNAME_COMPATIBILITY_MODE : __( 'Undefined', 'buddypress' ),
     987                'debug' => defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) ? BP_ENABLE_USERNAME_COMPATIBILITY_MODE : 'undefined',
     988            ),
     989            'BP_AVATAR_DEFAULT_THUMB'               => array(
     990                'label' => 'BP_AVATAR_DEFAULT_THUMB',
     991                'value' => defined( 'BP_AVATAR_DEFAULT_THUMB' ) ? BP_AVATAR_DEFAULT_THUMB : __( 'Undefined', 'buddypress' ),
     992                'debug' => defined( 'BP_AVATAR_DEFAULT_THUMB' ) ? BP_AVATAR_DEFAULT_THUMB : 'undefined',
     993            ),
     994            'BP_AVATAR_DEFAULT'                     => array(
     995                'label' => 'BP_AVATAR_DEFAULT',
     996                'value' => defined( 'BP_AVATAR_DEFAULT' ) ? BP_AVATAR_DEFAULT : __( 'Undefined', 'buddypress' ),
     997                'debug' => defined( 'BP_AVATAR_DEFAULT' ) ? BP_AVATAR_DEFAULT : 'undefined',
     998            ),
     999            'BP_AVATAR_URL'                         => array(
     1000                'label' => 'BP_AVATAR_URL',
     1001                'value' => defined( 'BP_AVATAR_URL' ) ? BP_AVATAR_URL : __( 'Undefined', 'buddypress' ),
     1002                'debug' => defined( 'BP_AVATAR_URL' ) ? BP_AVATAR_URL : 'undefined',
     1003            ),
     1004            'BP_AVATAR_UPLOAD_PATH'                 => array(
     1005                'label' => 'BP_AVATAR_UPLOAD_PATH',
     1006                'value' => defined( 'BP_AVATAR_UPLOAD_PATH' ) ? BP_AVATAR_UPLOAD_PATH : __( 'Undefined', 'buddypress' ),
     1007                'debug' => defined( 'BP_AVATAR_UPLOAD_PATH' ) ? BP_AVATAR_UPLOAD_PATH : 'undefined',
     1008            ),
     1009            'BP_SHOW_AVATARS'                       => array(
     1010                'label' => 'BP_SHOW_AVATARS',
     1011                'value' => defined( 'BP_SHOW_AVATARS' ) && BP_SHOW_AVATARS ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ),
     1012                'debug' => defined( 'BP_SHOW_AVATARS' ) ? BP_SHOW_AVATARS : 'undefined',
     1013            ),
     1014            'BP_AVATAR_ORIGINAL_MAX_WIDTH'          => array(
     1015                'label' => 'BP_AVATAR_ORIGINAL_MAX_WIDTH',
     1016                'value' => BP_AVATAR_ORIGINAL_MAX_WIDTH,
     1017            ),
     1018            'BP_AVATAR_ORIGINAL_MAX_FILESIZE'       => array(
     1019                'label' => 'BP_AVATAR_ORIGINAL_MAX_FILESIZE',
     1020                'value' => size_format( BP_AVATAR_ORIGINAL_MAX_FILESIZE ),
     1021                'debug' => BP_AVATAR_ORIGINAL_MAX_FILESIZE,
     1022            ),
     1023            'BP_AVATAR_FULL_HEIGHT'                 => array(
     1024                'label' => 'BP_AVATAR_FULL_HEIGHT',
     1025                'value' => BP_AVATAR_FULL_HEIGHT,
     1026            ),
     1027            'BP_AVATAR_FULL_WIDTH'                  => array(
     1028                'label' => 'BP_AVATAR_FULL_WIDTH',
     1029                'value' => BP_AVATAR_FULL_WIDTH,
     1030            ),
     1031            'BP_AVATAR_THUMB_HEIGHT'                => array(
     1032                'label' => 'BP_AVATAR_THUMB_HEIGHT',
     1033                'value' => BP_AVATAR_THUMB_HEIGHT,
     1034            ),
     1035            'BP_AVATAR_THUMB_WIDTH'                 => array(
     1036                'label' => 'BP_AVATAR_THUMB_WIDTH',
     1037                'value' => BP_AVATAR_THUMB_WIDTH,
     1038            ),
     1039            'BP_FORUMS_PARENT_FORUM_ID'             => array(
     1040                'label' => 'BP_FORUMS_PARENT_FORUM_ID',
     1041                'value' => defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ? BP_FORUMS_PARENT_FORUM_ID : __( 'Undefined', 'buddypress' ),
     1042                'debug' => defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ? BP_FORUMS_PARENT_FORUM_ID : 'undefined',
     1043            ),
     1044            'BP_FORUMS_SLUG'                        => array(
     1045                'label' => 'BP_FORUMS_SLUG',
     1046                'value' => defined( 'BP_FORUMS_SLUG' ) ? BP_FORUMS_SLUG : __( 'Undefined', 'buddypress' ),
     1047                'debug' => defined( 'BP_FORUMS_SLUG' ) ? BP_FORUMS_SLUG : 'undefined',
     1048            ),
     1049            'BP_SEARCH_SLUG'                        => array(
     1050                'label' => 'BP_SEARCH_SLUG',
     1051                'value' => defined( 'BP_SEARCH_SLUG' ) ? BP_SEARCH_SLUG : __( 'Undefined', 'buddypress' ),
     1052                'debug' => defined( 'BP_SEARCH_SLUG' ) ? BP_SEARCH_SLUG : 'undefined',
     1053            ),
    9641054            'BP_SIGNUPS_SKIP_USER_CREATION'         => array(
    9651055                'label' => 'BP_SIGNUPS_SKIP_USER_CREATION (deprecated)',
     
    9671057                'debug' => defined( 'BP_SIGNUPS_SKIP_USER_CREATION' ) ? BP_SIGNUPS_SKIP_USER_CREATION : 'undefined',
    9681058            ),
    969             'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH' => array(
    970                 'label' => 'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH',
    971                 'value' => defined( 'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH' ) ? BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH : __( 'Undefined', 'buddypress' ),
    972                 'debug' => defined( 'BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH' ) ? BP_MEMBERS_REQUIRED_PASSWORD_STRENGTH : 'undefined',
    973             ),
    974             'BP_EMBED_DISABLE_PRIVATE_MESSAGES'     => array(
    975                 'label' => 'BP_EMBED_DISABLE_PRIVATE_MESSAGES',
    976                 'value' => defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) ? BP_EMBED_DISABLE_PRIVATE_MESSAGES : __( 'Undefined', 'buddypress' ),
    977                 'debug' => defined( 'BP_EMBED_DISABLE_PRIVATE_MESSAGES' ) ? BP_EMBED_DISABLE_PRIVATE_MESSAGES : 'undefined',
    978             ),
    979             'BP_EMBED_DISABLE_ACTIVITY_REPLIES'     => array(
    980                 'label' => 'BP_EMBED_DISABLE_ACTIVITY_REPLIES',
    981                 'value' => defined( 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' ) ? BP_EMBED_DISABLE_ACTIVITY_REPLIES : __( 'Undefined', 'buddypress' ),
    982                 'debug' => defined( 'BP_EMBED_DISABLE_ACTIVITY_REPLIES' ) ? BP_EMBED_DISABLE_ACTIVITY_REPLIES : 'undefined',
    983             ),
    984             'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' => array(
    985                 'label' => 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE',
    986                 'value' => defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) ? BP_ENABLE_USERNAME_COMPATIBILITY_MODE : __( 'Undefined', 'buddypress' ),
    987                 'debug' => defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) ? BP_ENABLE_USERNAME_COMPATIBILITY_MODE : 'undefined',
    988             ),
    989             'BP_AVATAR_DEFAULT_THUMB'               => array(
    990                 'label' => 'BP_AVATAR_DEFAULT_THUMB',
    991                 'value' => defined( 'BP_AVATAR_DEFAULT_THUMB' ) ? BP_AVATAR_DEFAULT_THUMB : __( 'Undefined', 'buddypress' ),
    992                 'debug' => defined( 'BP_AVATAR_DEFAULT_THUMB' ) ? BP_AVATAR_DEFAULT_THUMB : 'undefined',
    993             ),
    994             'BP_AVATAR_DEFAULT'                     => array(
    995                 'label' => 'BP_AVATAR_DEFAULT',
    996                 'value' => defined( 'BP_AVATAR_DEFAULT' ) ? BP_AVATAR_DEFAULT : __( 'Undefined', 'buddypress' ),
    997                 'debug' => defined( 'BP_AVATAR_DEFAULT' ) ? BP_AVATAR_DEFAULT : 'undefined',
    998             ),
    999             'BP_AVATAR_URL'                         => array(
    1000                 'label' => 'BP_AVATAR_URL',
    1001                 'value' => defined( 'BP_AVATAR_URL' ) ? BP_AVATAR_URL : __( 'Undefined', 'buddypress' ),
    1002                 'debug' => defined( 'BP_AVATAR_URL' ) ? BP_AVATAR_URL : 'undefined',
    1003             ),
    1004             'BP_AVATAR_UPLOAD_PATH'                 => array(
    1005                 'label' => 'BP_AVATAR_UPLOAD_PATH',
    1006                 'value' => defined( 'BP_AVATAR_UPLOAD_PATH' ) ? BP_AVATAR_UPLOAD_PATH : __( 'Undefined', 'buddypress' ),
    1007                 'debug' => defined( 'BP_AVATAR_UPLOAD_PATH' ) ? BP_AVATAR_UPLOAD_PATH : 'undefined',
    1008             ),
    1009             'BP_SHOW_AVATARS'                       => array(
    1010                 'label' => 'BP_SHOW_AVATARS',
    1011                 'value' => defined( 'BP_SHOW_AVATARS' ) && BP_SHOW_AVATARS ? __( 'Enabled', 'buddypress' ) : __( 'Disabled', 'buddypress' ),
    1012                 'debug' => defined( 'BP_SHOW_AVATARS' ) ? BP_SHOW_AVATARS : 'undefined',
    1013             ),
    1014             'BP_AVATAR_ORIGINAL_MAX_WIDTH'          => array(
    1015                 'label' => 'BP_AVATAR_ORIGINAL_MAX_WIDTH',
    1016                 'value' => BP_AVATAR_ORIGINAL_MAX_WIDTH,
    1017             ),
    1018             'BP_AVATAR_ORIGINAL_MAX_FILESIZE'       => array(
    1019                 'label' => 'BP_AVATAR_ORIGINAL_MAX_FILESIZE',
    1020                 'value' => size_format( BP_AVATAR_ORIGINAL_MAX_FILESIZE ),
    1021                 'debug' => BP_AVATAR_ORIGINAL_MAX_FILESIZE,
    1022             ),
    1023             'BP_AVATAR_FULL_HEIGHT'                 => array(
    1024                 'label' => 'BP_AVATAR_FULL_HEIGHT',
    1025                 'value' => BP_AVATAR_FULL_HEIGHT,
    1026             ),
    1027             'BP_AVATAR_FULL_WIDTH'                  => array(
    1028                 'label' => 'BP_AVATAR_FULL_WIDTH',
    1029                 'value' => BP_AVATAR_FULL_WIDTH,
    1030             ),
    1031             'BP_AVATAR_THUMB_HEIGHT'                => array(
    1032                 'label' => 'BP_AVATAR_THUMB_HEIGHT',
    1033                 'value' => BP_AVATAR_THUMB_HEIGHT,
    1034             ),
    1035             'BP_AVATAR_THUMB_WIDTH'                 => array(
    1036                 'label' => 'BP_AVATAR_THUMB_WIDTH',
    1037                 'value' => BP_AVATAR_THUMB_WIDTH,
    1038             ),
    10391059            'BP_USE_WP_ADMIN_BAR'                   => array(
    10401060                'label' => 'BP_USE_WP_ADMIN_BAR (deprecated)',
     
    10471067                'debug' => defined( 'BP_FRIENDS_DB_VERSION' ) ? BP_FRIENDS_DB_VERSION : 'undefined',
    10481068            ),
    1049             'BP_FORUMS_PARENT_FORUM_ID'             => array(
    1050                 'label' => 'BP_FORUMS_PARENT_FORUM_ID (deprecated)',
    1051                 'value' => defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ? BP_FORUMS_PARENT_FORUM_ID : __( 'Undefined', 'buddypress' ),
    1052                 'debug' => defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ? BP_FORUMS_PARENT_FORUM_ID : 'undefined',
    1053             ),
    10541069            'BP_MEMBERS_SLUG'                       => array(
    10551070                'label' => 'BP_MEMBERS_SLUG (deprecated)',
     
    10961111                'value' => defined( 'BP_XPROFILE_SLUG' ) ? BP_XPROFILE_SLUG : __( 'Undefined', 'buddypress' ),
    10971112                'debug' => defined( 'BP_XPROFILE_SLUG' ) ? BP_XPROFILE_SLUG : 'undefined',
    1098             ),
    1099             'BP_FORUMS_SLUG'                        => array(
    1100                 'label' => 'BP_FORUMS_SLUG (deprecated)',
    1101                 'value' => defined( 'BP_FORUMS_SLUG' ) ? BP_FORUMS_SLUG : __( 'Undefined', 'buddypress' ),
    1102                 'debug' => defined( 'BP_FORUMS_SLUG' ) ? BP_FORUMS_SLUG : 'undefined',
    1103             ),
    1104             'BP_SEARCH_SLUG'                        => array(
    1105                 'label' => 'BP_SEARCH_SLUG (deprecated)',
    1106                 'value' => defined( 'BP_SEARCH_SLUG' ) ? BP_SEARCH_SLUG : __( 'Undefined', 'buddypress' ),
    1107                 'debug' => defined( 'BP_SEARCH_SLUG' ) ? BP_SEARCH_SLUG : 'undefined',
    11081113            ),
    11091114        ),
  • branches/14.0/src/bp-xprofile/classes/class-bp-xprofile-component.php

    r13503 r14050  
    149149        // Defined conditionally to accommodate unit tests.
    150150        if ( ! defined( 'BP_XPROFILE_BASE_GROUP_NAME' ) ) {
    151             define( 'BP_XPROFILE_BASE_GROUP_NAME', stripslashes( bp_core_get_root_option( 'avatar_default' ) ) );
     151            define( 'BP_XPROFILE_BASE_GROUP_NAME', stripslashes( bp_core_get_root_option( 'bp-xprofile-base-group-name' ) ) );
    152152        }
    153153
Note: See TracChangeset for help on using the changeset viewer.