Skip to content

Commit

Permalink
Merge branch 'release' into PROD-7937
Browse files Browse the repository at this point in the history
* release: (65 commits)
Update: Grunt
Update: Grunt string-replace
Update: Version name update
Added change log
grunt
PROD-7997: Fixed lastname and nickname
[PROD-7757] geunt makepot
PROD-7997 - phpcbf fixes
PROD-7997 - code refactor
PROD-7757 translation
[ARCH-131] Code cleanup
[ARCH-131] Show suspend/unsuspend button tooltip over sidearea navigation
PROD-7997: Update xprofile field visibility migration logic
PROD-7997: Set xprofile field visibility when user update profile
[PROD-7757] Update activity notice for new profile avatar
PROD-7997: Fixed xprofile field visibility when user registered from backend
PROD-7997: Run xProfile field visibility migration on plugin update
PROD-7997: Fix xProfile field visibility migration
Revert "PROD-7997: Fix member search filter results in the member directory for non-admin users"
[ARCH-131] PROD-7948 - Add "suspend_conditions (user_suspended, hide_parent, hide_sitewide)" index for bp_suspend table - Add "user_id (user_id)" index for bp_suspend_details table
...
  • Loading branch information
jitendrabanjara1991 committed Nov 7, 2024
2 parents 0b6d7e8 + b3bbe9a commit a5df4e1
Show file tree
Hide file tree
Showing 47 changed files with 2,380 additions and 820 deletions.
2 changes: 1 addition & 1 deletion bp-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The BuddyBoss Platform adds community features to WordPress. Member Profiles, Activity Feeds, Direct Messaging, Notifications, and more!
* Author: BuddyBoss
* Author URI: https://buddyboss.com/
* Version: 2.7.20
* Version: 2.7.30
* Text Domain: buddyboss
* Domain Path: /bp-languages/
* License: GPLv2 or later (license.txt)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
},
"license": "GPL-2.0-or-later",
"version": "3.1.0",
"BBVersion": "2.7.20"
"BBVersion": "2.7.30"
}
20 changes: 15 additions & 5 deletions src/bp-core/admin/bp-core-admin-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1553,10 +1553,14 @@ function bp_core_admin_user_row_actions( $actions, $user_object ) {
$url
);
$unsuspend_link = wp_nonce_url( $url, 'bp-suspend-user' );
$suspend_id = bp_is_active( 'moderation' ) ? BP_Core_Suspend::get_suspend_id( $user_id, BP_Moderation_Members::$moderation_type ) : '';
$meta_value = ! empty( $suspend_id ) ? bb_suspend_get_meta( $suspend_id, 'suspend' ) : '';
$actions['unsuspend'] = sprintf(
'<a class="bp-unsuspend-user ham" href="%1$s" data-action="unsuspend">%2$s</a>',
esc_url( $unsuspend_link ),
esc_html__( 'Unsuspend', 'buddyboss' )
'<a class="ham %1$s" href="%2$s" data-action="unsuspend" %3$s>%4$s</a>',
! empty( $meta_value ) ? 'disabled' : 'bp-unsuspend-user',
! empty( $meta_value ) ? '#' : esc_url( $unsuspend_link ),
! empty( $meta_value ) ? 'data-bp-tooltip-pos="up" data-bp-tooltip="' . esc_attr__( 'The background process is currently in the queue. Please refresh the page after a short while', 'buddyboss' ) . '"' : '',
esc_html__( 'Unsuspend', 'buddyboss' ),
);

// If not already spammed, create spam link.
Expand All @@ -1569,12 +1573,18 @@ function bp_core_admin_user_row_actions( $actions, $user_object ) {
$url
);
$suspend_link = wp_nonce_url( $url, 'bp-suspend-user' );
$suspend_id = bp_is_active( 'moderation' ) ? BP_Core_Suspend::get_suspend_id( $user_id, BP_Moderation_Members::$moderation_type ) : '';
$meta_value = ! empty( $suspend_id ) ? bb_suspend_get_meta( $suspend_id, 'unsuspend' ) : '';
$actions['suspend'] = sprintf(
'<a class="submitdelete bp-suspend-user" href="%1$s" data-action="suspend">%2$s</a>',
esc_url( $suspend_link ),
'<a class="submitdelete %1$s" href="%2$s" data-action="suspend" %3$s>%4$s</a>',
! empty( $meta_value ) ? 'disabled' : 'bp-suspend-user',
! empty( $meta_value ) ? '#' : esc_url( $suspend_link ),
! empty( $meta_value ) ? 'data-bp-tooltip-pos="up" data-bp-tooltip="' . esc_attr__( 'The background process is currently in the queue. Please refresh the page after a short while', 'buddyboss' ) . '"' : '',
esc_html__( 'Suspend', 'buddyboss' )
);
}

unset( $suspend_link, $suspend_id, $meta_value );
}
}

Expand Down
16 changes: 14 additions & 2 deletions src/bp-core/admin/bp-core-admin-schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -1235,17 +1235,29 @@ function bp_core_install_suspend() {
KEY item_id (item_id),
KEY user_suspended (user_suspended),
KEY hide_parent (hide_parent),
KEY hide_sitewide (hide_sitewide)
KEY hide_sitewide (hide_sitewide),
KEY suspend_conditions (user_suspended, hide_parent, hide_sitewide),
) {$charset_collate};";

$sql[] = "CREATE TABLE {$bp_prefix}bp_suspend_details (
id bigint(20) NOT NULL AUTO_INCREMENT,
suspend_id bigint(20) NOT NULL,
user_id bigint(20) NOT NULL,
PRIMARY KEY (id),
KEY suspend_details_id (suspend_id,user_id)
KEY suspend_details_id (suspend_id,user_id),
KEY user_id (user_id)
) {$charset_collate};";

$sql[] = "CREATE TABLE {$bp_prefix}bp_suspend_meta (
id bigint(20) NOT NULL AUTO_INCREMENT,
suspend_id bigint(20) NOT NULL,
meta_key varchar(255) DEFAULT NULL,
meta_value longtext DEFAULT NULL,
PRIMARY KEY (id),
KEY suspend_id (suspend_id),
KEY meta_key (meta_key(191))
) {$charset_collate};";

dbDelta( $sql );
}

Expand Down
32 changes: 32 additions & 0 deletions src/bp-core/admin/css/common-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -3379,6 +3379,20 @@ table.moderations tbody tr .column-suspend .dashicons {
font-size: 24px;
}

table.moderations .bp-block-user.disabled {
cursor: default;
}

table.moderations .bp-block-user[data-bp-tooltip] {
display: inline-block;
}

table.moderations .bp-block-user[data-bp-tooltip]:after {
white-space: normal;
width: 210px;
text-align: center;
}

.buddyboss_page_bp-moderation .dashicons {
font-weight: 700;
}
Expand Down Expand Up @@ -3578,6 +3592,24 @@ table.moderations .column-member img {
content: "\ee6a";
}

table.users .suspend a.disabled,
table.users .unsuspend a.disabled {
cursor: default;
}

table.users .suspend a.disabled[data-bp-tooltip],
table.users .unsuspend a.disabled[data-bp-tooltip] {
display: inline-block;
}

table.users .suspend a.disabled[data-bp-tooltip]:after,
table.users .unsuspend a.disabled[data-bp-tooltip]:after {
white-space: normal;
width: 210px;
text-align: center;
z-index: 9999;
}

/*------------------------------------------------------------------------------
* 17.0 Domain restriction
*----------------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion src/bp-core/admin/css/common-rtl.min.css

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions src/bp-core/admin/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -3379,6 +3379,20 @@ table.moderations tbody tr .column-suspend .dashicons {
font-size: 24px;
}

table.moderations .bp-block-user.disabled {
cursor: default;
}

table.moderations .bp-block-user[data-bp-tooltip] {
display: inline-block;
}

table.moderations .bp-block-user[data-bp-tooltip]:after {
white-space: normal;
width: 210px;
text-align: center;
}

.buddyboss_page_bp-moderation .dashicons {
font-weight: 700;
}
Expand Down Expand Up @@ -3578,6 +3592,24 @@ table.moderations .column-member img {
content: "\ee6a";
}

table.users .suspend a.disabled,
table.users .unsuspend a.disabled {
cursor: default;
}

table.users .suspend a.disabled[data-bp-tooltip],
table.users .unsuspend a.disabled[data-bp-tooltip] {
display: inline-block;
}

table.users .suspend a.disabled[data-bp-tooltip]:after,
table.users .unsuspend a.disabled[data-bp-tooltip]:after {
white-space: normal;
width: 210px;
text-align: center;
z-index: 9999;
}

/*------------------------------------------------------------------------------
* 17.0 Domain restriction
*----------------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion src/bp-core/admin/css/common.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/bp-core/admin/js/moderation-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ jQuery( document ).ready(
var curObj = $( this );
var sub_action = curObj.attr( 'data-action' );

if ( curObj.hasClass( 'disabled' ) ) {
return false;
}

if ('suspend' === sub_action) {
if ( ! confirm( BP_ADMIN.moderation.suspend_confirm_message )) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/bp-core/admin/js/moderation-page.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions src/bp-core/admin/sass/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3647,6 +3647,23 @@ table.moderations {
}

}

.bp-block-user {

&.disabled {
cursor: default;
}

&[data-bp-tooltip] {
display: inline-block;

&:after {
white-space: normal;
width: 210px;
text-align: center;
}
}
}
}

.buddyboss_page_bp-moderation {
Expand Down Expand Up @@ -3883,6 +3900,28 @@ table.moderations .column-member {
}
}

table.users {

.suspend,
.unsuspend {

a.disabled {
cursor: default;
}

a.disabled[data-bp-tooltip] {
display: inline-block;

&:after {
white-space: normal;
width: 210px;
text-align: center;
z-index: 9999;
}
}
}
}

/*------------------------------------------------------------------------------
* 17.0 Domain restriction
*----------------------------------------------------------------------------*/
Expand Down
5 changes: 5 additions & 0 deletions src/bp-core/bp-core-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,11 @@ function bp_version_updater() {
if ( function_exists( 'bb_group_migration' ) ) {
bb_group_migration();
}

// Run migration about profile fields visibility.
if ( function_exists( 'bb_migrate_xprofile_visibility' ) ) {
bb_migrate_xprofile_visibility( true );
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/bp-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The BuddyBoss Platform adds community features to WordPress. Member Profiles, Activity Feeds, Direct Messaging, Notifications, and more!
* Author: BuddyBoss
* Author URI: https://buddyboss.com/
* Version: 2.7.20
* Version: 2.7.30
* Text Domain: buddyboss
* Domain Path: /languages/
* License: GPLv2 or later (license.txt)
Expand All @@ -24,7 +24,7 @@
}

if ( ! defined( 'BP_PLATFORM_VERSION' ) ) {
define( 'BP_PLATFORM_VERSION', '2.7.20' );
define( 'BP_PLATFORM_VERSION', '2.7.30' );
}

if ( ! defined( 'BP_PLATFORM_API' ) ) {
Expand Down
12 changes: 12 additions & 0 deletions src/bp-members/bp-members-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,18 @@ function bp_core_map_user_registration( $user_id, $by_pass = false ) {
xprofile_set_field_data( bp_xprofile_lastname_field_id(), $user_id, $lastname );
xprofile_set_field_data( bp_xprofile_nickname_field_id(), $user_id, $nickname );

$default_field_ids = array(
bp_xprofile_firstname_field_id(),
bp_xprofile_lastname_field_id(),
bp_xprofile_nickname_field_id(),
);

// Set visibility levels for the default fields.
foreach ( $default_field_ids as $field_id ) {
$visibility = xprofile_get_field_visibility_level( $field_id, $user_id );
xprofile_set_field_visibility_level( $field_id, $user_id, $visibility );
}

bp_xprofile_update_display_name( $user_id );
}

Expand Down
Loading

0 comments on commit a5df4e1

Please sign in to comment.