Changeset 3263514
- Timestamp:
- 03/28/2025 12:57:59 PM (11 months ago)
- Location:
- bp-groups-civicrm-sync/trunk
- Files:
-
- 8 edited
-
bp-groups-civicrm-sync.php (modified) (4 diffs)
-
includes/buddypress/class-buddypress-group-member.php (modified) (13 diffs)
-
includes/civicrm/class-civicrm-group-contact.php (modified) (1 diff)
-
includes/civicrm/class-civicrm-group-meta.php (modified) (1 diff)
-
includes/civicrm/class-civicrm-group.php (modified) (2 diffs)
-
includes/wp-cli/commands/command-job.php (modified) (2 diffs)
-
languages/bp-groups-civicrm-sync.pot (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bp-groups-civicrm-sync/trunk/bp-groups-civicrm-sync.php
r3147635 r3263514 5 5 * Plugin Name: BP Groups CiviCRM Sync 6 6 * Description: Enables two-way synchronisation between BuddyPress Groups and CiviCRM Groups. 7 * Version: 0.5. 27 * Version: 0.5.3 8 8 * Plugin URI: https://github.com/christianwach/bp-groups-civicrm-sync 9 9 * GitHub Plugin URI: https://github.com/christianwach/bp-groups-civicrm-sync … … 18 18 * 19 19 * @package BP_Groups_CiviCRM_Sync 20 * @link https://github.com/christianwach/bp-groups-civicrm-sync 21 * @license GPL v2 or later 22 * 23 * This program is free software; you can redistribute it and/or modify 24 * it under the terms of the GNU General Public License as published by 25 * the Free Software Foundation; either version 2 of the License, or 26 * (at your option) any later version. 27 * 28 * This program is distributed in the hope that it will be useful, 29 * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 * GNU General Public License for more details. 20 32 */ 21 33 … … 24 36 25 37 // Set our version here. 26 define( 'BP_GROUPS_CIVICRM_SYNC_VERSION', '0.5. 2' );38 define( 'BP_GROUPS_CIVICRM_SYNC_VERSION', '0.5.3' ); 27 39 28 40 // Store reference to this file. … … 267 279 268 280 // Load translations if there are any. 281 // phpcs:ignore WordPress.WP.DeprecatedParameters.Load_plugin_textdomainParam2Found 269 282 load_plugin_textdomain( 270 283 'bp-groups-civicrm-sync', // Unique name. -
bp-groups-civicrm-sync/trunk/includes/buddypress/class-buddypress-group-member.php
r3035828 r3263514 39 39 40 40 /** 41 * Store for previous Group Status.42 * 43 * @since 0.5. 041 * Store for bridging data between pre and post callbacks. 42 * 43 * @since 0.5.3 44 44 * @access private 45 45 * @var array 46 46 */ 47 public $ old_status= [];47 public $bridging_array = []; 48 48 49 49 /** … … 94 94 $this->register_hooks_group_members(); 95 95 96 // Catch Groups admin page load.97 add_action( 'bp_groups_admin_load', [ $this, 'register_hooks_bp_groups_admin' ], 10, 1 );98 99 96 } 100 97 … … 121 118 public function register_hooks_group_members() { 122 119 123 // User joins or leaves Group. 124 add_action( 'groups_join_group', [ $this, 'member_just_joined_group' ], 5, 2 ); 125 add_action( 'groups_leave_group', [ $this, 'civicrm_group_membership_delete' ], 5, 2 ); 126 127 // User's Group Membership was removed. 128 add_action( 'groups_removed_member', [ $this, 'member_removed_from_group' ], 10, 2 ); 129 130 // Group Membership status is being reduced. 131 add_action( 'groups_demote_member', [ $this, 'member_reduce_status' ], 10, 2 ); 132 add_action( 'groups_ban_member', [ $this, 'member_reduce_status' ], 10, 2 ); 133 134 // Group Membership modified. 135 add_action( 'groups_promoted_member', [ $this, 'member_changed_status' ], 10, 2 ); 136 add_action( 'groups_demoted_member', [ $this, 'member_changed_status' ], 10, 2 ); 137 add_action( 'groups_unbanned_member', [ $this, 'member_changed_status' ], 10, 2 ); 138 add_action( 'groups_banned_member', [ $this, 'member_changed_status' ], 10, 2 ); 139 add_action( 'groups_membership_accepted', [ $this, 'member_changed_status' ], 10, 2 ); 140 add_action( 'groups_accept_invite', [ $this, 'member_changed_status' ], 10, 2 ); 120 // Before and after a Group Membership is saved. 121 add_action( 'groups_member_before_save', [ $this, 'member_save_pre' ], 9 ); 122 add_action( 'groups_member_after_save', [ $this, 'member_save_post' ], 9 ); 123 124 // Before and after a Group Membership is removed. 125 add_action( 'groups_member_before_remove', [ $this, 'member_remove_pre' ], 9 ); 126 add_action( 'groups_member_after_remove', [ $this, 'member_remove_post' ], 9 ); 127 128 // Before and after a Group Membership is deleted. 129 add_action( 'bp_groups_member_before_delete', [ $this, 'member_delete_pre' ], 9, 2 ); 130 add_action( 'bp_groups_member_after_delete', [ $this, 'member_delete_post' ], 9, 2 ); 141 131 142 132 } … … 151 141 152 142 // Remove callbacks. 153 remove_action( 'groups_join_group', [ $this, 'member_just_joined_group' ], 5 ); 154 remove_action( 'groups_leave_group', [ $this, 'civicrm_group_membership_delete' ], 5 ); 155 remove_action( 'groups_removed_member', [ $this, 'member_removed_from_group' ], 10 ); 156 remove_action( 'groups_demote_member', [ $this, 'member_reduce_status' ], 10 ); 157 remove_action( 'groups_ban_member', [ $this, 'member_reduce_status' ], 10 ); 158 remove_action( 'groups_promoted_member', [ $this, 'member_changed_status' ], 10 ); 159 remove_action( 'groups_demoted_member', [ $this, 'member_changed_status' ], 10 ); 160 remove_action( 'groups_unbanned_member', [ $this, 'member_changed_status' ], 10 ); 161 remove_action( 'groups_banned_member', [ $this, 'member_changed_status' ], 10 ); 162 remove_action( 'groups_membership_accepted', [ $this, 'member_changed_status' ], 10 ); 163 remove_action( 'groups_accept_invite', [ $this, 'member_changed_status' ], 10 ); 164 165 } 166 167 /** 168 * Adds hooks when the Groups admin page is loaded. 169 * 170 * None of the "past tense" actions fire on the Groups admin page, so we 171 * have to hook into the "present tense" actions and figure out what's going 172 * on at that point. 173 * 174 * @since 0.2.2 175 * @since 0.5.0 Moved to this class. 176 * 177 * @param string $doaction Current $_GET action being performed in admin screen. 178 */ 179 public function register_hooks_bp_groups_admin( $doaction ) { 180 181 // Only add hooks if saving data. 182 if ( $doaction && 'save' === $doaction ) { 183 184 // Group Membership hooks: Group Membership status is being modified. 185 add_action( 'groups_promote_member', [ $this, 'member_changing_status' ], 10, 3 ); 186 add_action( 'groups_demote_member', [ $this, 'member_changing_status' ], 10, 2 ); 187 add_action( 'groups_unban_member', [ $this, 'member_changing_status' ], 10, 2 ); 188 add_action( 'groups_ban_member', [ $this, 'member_changing_status' ], 10, 2 ); 189 190 // User is being removed from Group. 191 add_action( 'groups_remove_member', [ $this, 'civicrm_group_membership_delete' ], 10, 2 ); 192 193 } 143 remove_action( 'groups_member_before_save', [ $this, 'member_save_pre' ], 9 ); 144 remove_action( 'groups_member_after_save', [ $this, 'member_save_post' ], 9 ); 145 remove_action( 'groups_member_before_remove', [ $this, 'member_remove_pre' ], 9 ); 146 remove_action( 'groups_member_after_remove', [ $this, 'member_remove_post' ], 9 ); 147 remove_action( 'bp_groups_member_before_delete', [ $this, 'member_delete_pre' ], 9 ); 148 remove_action( 'bp_groups_member_after_delete', [ $this, 'member_delete_post' ], 9 ); 194 149 195 150 } … … 198 153 199 154 /** 200 * Called when User joins Group. 201 * 202 * @since 0.1 203 * @since 0.5.0 Moved to this class. 204 * 205 * @param int $group_id The numeric ID of the BuddyPress Group. 206 * @param int $user_id The numeric ID of the WordPress User. 207 */ 208 public function member_just_joined_group( $group_id, $user_id ) { 209 210 // Call update method. 211 $this->civicrm_group_membership_update( $user_id, $group_id ); 212 213 } 214 215 /** 216 * Called when User's Group status is about to change. 217 * 218 * Parameter order ($group_id, $user_id) is the opposite of the "past tense" 219 * hooks. Compare, for example, 'groups_promoted_member'. 220 * 221 * @see $this->register_hooks_bp_groups_admin() 222 * 223 * @since 0.2.2 224 * @since 0.5.0 Moved to this class. 225 * 226 * @param int $group_id The numeric ID of the BuddyPress Group. 227 * @param int $user_id The numeric ID of the WordPress User. 228 * @param string $status New status being changed to. 229 */ 230 public function member_changing_status( $group_id, $user_id, $status = '' ) { 231 232 // If we have no status, check if User is Group Admin. 233 if ( empty( $status ) ) { 234 $status = groups_is_user_admin( $user_id, $group_id ) ? 'admin' : ''; 235 } 236 237 /* 238 * Group Admins cannot be banned. 239 * @see BP_Groups_Member::ban() 240 */ 241 if ( 'admin' === $status && current_action() === 'groups_ban_member' ) { 242 return; 243 } 244 245 // If a Group Admin is being demoted, set special status. 246 if ( 'admin' === $status && current_action() === 'groups_demote_member' ) { 247 $status = 'ex-admin'; 248 } 155 * Called before a Group Membership is saved. 156 * 157 * @since 0.5.3 158 * 159 * @param BP_Groups_Member $member The BP Groups Member instance. 160 */ 161 public function member_save_pre( $member ) { 162 163 // Sanity check. 164 if ( ! ( $member instanceof BP_Groups_Member ) ) { 165 return; 166 } 167 168 // Get the previous Group Membership. 169 $previous_member = new BP_Groups_Member( $member->user_id, $member->group_id ); 170 171 // Add Group Membership object to the bridging array. 172 $this->bridging_array['save'][ $member->group_id ][ $member->user_id ] = $previous_member; 173 174 } 175 176 /** 177 * Called after a Group Membership is saved. 178 * 179 * @since 0.5.3 180 * 181 * @param BP_Groups_Member $member The BP Groups Member instance. 182 */ 183 public function member_save_post( BP_Groups_Member $member ) { 184 185 // Bail if we do not have an entry in the bridging array. 186 if ( empty( $this->bridging_array['save'][ $member->group_id ][ $member->user_id ] ) ) { 187 return; 188 } 189 190 // Okay, let's get it. 191 $previous = $this->bridging_array['save'][ $member->group_id ][ $member->user_id ]; 192 unset( $this->bridging_array['save'][ $member->group_id ][ $member->user_id ] ); 249 193 250 194 // Is this User being banned? 251 195 $is_active = 1; 252 if ( current_action() === 'groups_ban_member') {196 if ( 0 === (int) $previous->is_banned && 1 === (int) $member->is_banned ) { 253 197 $is_active = 0; 198 } 199 200 // Our "status" is simply to distinguish between admins and others. 201 $status = ( 1 === (int) $member->is_admin ) ? 'admin' : ''; 202 203 // If a Group Admin is being demoted, set special status. 204 if ( '' === $status && 1 === $previous->is_admin ) { 205 $status = 'ex-admin'; 254 206 } 255 207 … … 257 209 $args = [ 258 210 'action' => 'add', 211 'group_id' => $member->group_id, 212 'user_id' => $member->user_id, 213 'status' => $status, 214 'is_active' => $is_active, 215 ]; 216 217 // Update the corresponding CiviCRM Group memberships. 218 $this->plugin->civicrm->group_contact->memberships_sync( $args ); 219 220 } 221 222 /** 223 * Called before a Group Membership is removed. 224 * 225 * @since 0.5.3 226 * 227 * @param BP_Groups_Member $member The BP Groups Member instance. 228 */ 229 public function member_remove_pre( BP_Groups_Member $member ) { 230 231 // Sanity check. 232 if ( ! ( $member instanceof BP_Groups_Member ) ) { 233 return; 234 } 235 236 // Get the previous Group Membership. 237 $previous_member = new BP_Groups_Member( $member->user_id, $member->group_id ); 238 239 // Add Group Membership object to the bridging array. 240 $this->bridging_array['remove'][ $member->group_id ][ $member->user_id ] = $previous_member; 241 242 } 243 244 /** 245 * Called after a Group Membership is removed. 246 * 247 * @since 0.5.3 248 * 249 * @param BP_Groups_Member $member The BP Groups Member instance. 250 */ 251 public function member_remove_post( BP_Groups_Member $member ) { 252 253 // Bail if we do not have an entry in the bridging array. 254 if ( empty( $this->bridging_array['remove'][ $member->group_id ][ $member->user_id ] ) ) { 255 return; 256 } 257 258 // Okay, let's get it. 259 $previous = $this->bridging_array['remove'][ $member->group_id ][ $member->user_id ]; 260 unset( $this->bridging_array['remove'][ $member->group_id ][ $member->user_id ] ); 261 262 // Our "status" is simply to distinguish between admins and others. 263 $status = ( 1 === (int) $member->is_admin ) ? 'admin' : ''; 264 265 // Update Membership of CiviCRM Group. 266 $args = [ 267 'action' => 'delete', 268 'group_id' => $member->group_id, 269 'user_id' => $member->user_id, 270 'status' => $status, 271 'is_active' => 0, 272 ]; 273 274 // Update the corresponding CiviCRM Group memberships. 275 $this->plugin->civicrm->group_contact->memberships_sync( $args ); 276 277 } 278 279 /** 280 * Called before a Group Membership is deleted. 281 * 282 * @since 0.5.3 283 * 284 * @param int $user_id The numeric ID of the WordPress User. 285 * @param int $group_id The numeric ID of the BuddyPress Group. 286 */ 287 public function member_delete_pre( $user_id, $group_id ) { 288 289 // Get the previous Group Membership. 290 $previous_member = new BP_Groups_Member( $user_id, $group_id ); 291 292 // Add Group Membership object to the bridging array. 293 $this->bridging_array['delete'][ $group_id ][ $user_id ] = $previous_member; 294 295 } 296 297 /** 298 * Called after a Group Membership is deleted. 299 * 300 * @since 0.5.3 301 * 302 * @param int $user_id The numeric ID of the WordPress User. 303 * @param int $group_id The numeric ID of the BuddyPress Group. 304 */ 305 public function member_delete_post( $user_id, $group_id ) { 306 307 // Bail if we do not have an entry in the bridging array. 308 if ( empty( $this->bridging_array['delete'][ $group_id ][ $user_id ] ) ) { 309 return; 310 } 311 312 // Okay, let's get it. 313 $previous = $this->bridging_array['delete'][ $group_id ][ $user_id ]; 314 unset( $this->bridging_array['delete'][ $group_id ][ $user_id ] ); 315 316 // Our "status" is simply to distinguish between admins and others. 317 $status = ( 1 === (int) $previous->is_admin ) ? 'admin' : ''; 318 319 // Update Membership of CiviCRM Group. 320 $args = [ 321 'action' => 'delete', 259 322 'group_id' => $group_id, 260 323 'user_id' => $user_id, 261 324 'status' => $status, 262 'is_active' => $is_active,325 'is_active' => 0, 263 326 ]; 264 327 265 328 // Update the corresponding CiviCRM Group memberships. 266 329 $this->plugin->civicrm->group_contact->memberships_sync( $args ); 267 268 }269 270 /**271 * Called when User's Group status is being reduced.272 *273 * @since 0.4274 * @since 0.5.0 Moved to this class.275 *276 * @param int $group_id The numeric ID of the BuddyPress Group.277 * @param int $user_id The numeric ID of the WordPress User.278 */279 public function member_reduce_status( $group_id, $user_id ) {280 281 // Bail if not on front-end.282 if ( is_admin() ) {283 return;284 }285 286 // Check if User is Group Admin.287 $status = groups_is_user_admin( $user_id, $group_id ) ? 'admin' : '';288 289 /*290 * Group Admins cannot be banned.291 * @see BP_Groups_Member::ban()292 */293 if ( 'admin' === $status && current_action() === 'groups_ban_member' ) {294 return;295 }296 297 // If a Group Admin is being demoted, set special status.298 if ( 'admin' === $status && current_action() === 'groups_demote_member' ) {299 $status = 'ex-admin';300 }301 302 // Set a flag for use in "past tense" callback.303 $this->old_status[ $group_id ][ $user_id ] = $status;304 305 }306 307 /**308 * Called when User's Group status has changed.309 *310 * Parameter order ($user_id, $group_id) is reversed for these "past tense"311 * hooks. Compare, for example, 'groups_join_group', 'groups_promote_member'312 * and other "present tense" hooks.313 *314 * @since 0.1315 * @since 0.5.0 Moved to this class.316 *317 * @param int $user_id The numeric ID of the WordPress User.318 * @param int $group_id The numeric ID of the BuddyPress Group.319 */320 public function member_changed_status( $user_id, $group_id ) {321 322 // Call update method.323 $this->civicrm_group_membership_update( $user_id, $group_id );324 325 }326 327 /**328 * Called when a User has been removed from a Group.329 *330 * Parameter order ($user_id, $group_id) is reversed for this "past tense"331 * hook. Compare, for example, 'groups_join_group'.332 *333 * @since 0.2.2334 * @since 0.5.0 Moved to this class.335 *336 * @param int $user_id The numeric ID of the WordPress User.337 * @param int $group_id The numeric ID of the BuddyPress Group.338 */339 public function member_removed_from_group( $user_id, $group_id ) {340 341 // Call delete method.342 $this->civicrm_group_membership_delete( $group_id, $user_id );343 330 344 331 } … … 364 351 365 352 // Get current Member status. 366 $status = $this->status_get_for_user( $user_id, $group_id ); 367 368 // Check previous Member status. 369 if ( ! empty( $this->old_status[ $group_id ][ $user_id ] ) && 'ex-admin' === $this->old_status[ $group_id ][ $user_id ] ) { 370 $status = $this->old_status[ $group_id ][ $user_id ]; 371 unset( $this->old_status[ $group_id ][ $user_id ] ); 353 $status = false; 354 if ( groups_is_user_admin( $user_id, $group_id ) ) { 355 $status = 'admin'; 356 } elseif ( groups_is_user_mod( $user_id, $group_id ) ) { 357 $status = 'mod'; 358 } elseif ( groups_is_user_member( $user_id, $group_id ) ) { 359 $status = 'member'; 372 360 } 373 361 … … 395 383 } 396 384 397 /**398 * Inform CiviCRM of Membership status change.399 *400 * @since 0.1401 * @since 0.5.0 Moved to this class.402 *403 * @param int $group_id The numeric ID of the BuddyPress Group.404 * @param int $user_id The numeric ID of the WordPress User.405 * @return array|bool $result The result of the update, or false on failure.406 */407 public function civicrm_group_membership_delete( $group_id, $user_id ) {408 409 // Bail if sync should not happen for this Group.410 if ( ! $this->bp->group->should_be_synced( $group_id ) ) {411 return;412 }413 414 // Get current User status.415 $status = $this->status_get_for_user( $user_id, $group_id );416 417 // Remove Membership of CiviCRM Groups.418 $args = [419 'action' => 'delete',420 'group_id' => $group_id,421 'user_id' => $user_id,422 'status' => $status,423 'is_active' => 0,424 ];425 426 // Remove the corresponding CiviCRM Group memberships.427 $result = $this->plugin->civicrm->group_contact->memberships_sync( $args );428 429 // --<430 return $result;431 432 }433 434 385 // ----------------------------------------------------------------------------------- 435 386 … … 805 756 806 757 // Unhook our action to prevent BuddyPress->CiviCRM sync. 807 remove_action( 'groups_join_group', [ $this, 'member_just_joined_group' ], 5);758 $this->unregister_hooks_group_members(); 808 759 809 760 // Use BuddyPress function. … … 811 762 812 763 // Re-hook our action to enable BuddyPress->CiviCRM sync. 813 add_action( 'groups_join_group', [ $this, 'member_just_joined_group' ], 5, 2);764 $this->register_hooks_group_members(); 814 765 815 766 /* … … 881 832 do_action( 'groups_remove_member', $group_id, $user_id ); 882 833 834 // Unhook our action to prevent BuddyPress->CiviCRM sync. 835 $this->unregister_hooks_group_members(); 836 883 837 // Remove Member. 884 838 $success = $member->remove(); 839 840 // Re-hook our action to enable BuddyPress->CiviCRM sync. 841 $this->register_hooks_group_members(); 885 842 886 843 // --< … … 932 889 do_action( 'groups_demote_member', $group_id, $user_id ); 933 890 891 // Unhook our action to prevent BuddyPress->CiviCRM sync. 892 $this->unregister_hooks_group_members(); 893 934 894 // Demote them. 935 895 $success = $member->demote(); 896 897 // Re-hook our action to enable BuddyPress->CiviCRM sync. 898 $this->register_hooks_group_members(); 936 899 937 900 // --< … … 985 948 do_action( 'groups_promote_member', $group_id, $user_id, $status ); 986 949 950 // Unhook our action to prevent BuddyPress->CiviCRM sync. 951 $this->unregister_hooks_group_members(); 952 987 953 // Promote them. 988 954 $success = $member->promote( $status ); 989 955 956 // Re-hook our action to enable BuddyPress->CiviCRM sync. 957 $this->register_hooks_group_members(); 958 990 959 // --< 991 960 return $success; 992 993 }994 995 // -----------------------------------------------------------------------------------996 997 /**998 * Get BuddyPress Group Membership status for a User.999 *1000 * The following is modified code from the BuddyPress Groupblog plugin.1001 *1002 * @see bp_groupblog_upgrade_user()1003 *1004 * @since 0.11005 * @since 0.5.0 Moved to this class.1006 *1007 * @param int $user_id The numeric ID of the WordPress User.1008 * @param int $group_id The numeric ID of the BuddyPress Group.1009 * @return string $user_group_status The Membership status for a User.1010 */1011 public function status_get_for_user( $user_id, $group_id ) {1012 1013 // Check BuddyPress config.1014 if ( ! $this->bp->is_configured() ) {1015 return false;1016 }1017 1018 // Init return.1019 $user_group_status = false;1020 1021 // Fall back to BuddyPress functions if not set.1022 if ( groups_is_user_admin( $user_id, $group_id ) ) {1023 $user_group_status = 'admin';1024 } elseif ( groups_is_user_mod( $user_id, $group_id ) ) {1025 $user_group_status = 'mod';1026 } elseif ( groups_is_user_member( $user_id, $group_id ) ) {1027 $user_group_status = 'member';1028 }1029 1030 // Are we promoting or demoting?1031 if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) ) {1032 1033 // Change User status based on promotion / demotion.1034 switch ( bp_action_variable( 1 ) ) {1035 1036 case 'promote':1037 $user_group_status = bp_action_variable( 2 );1038 break;1039 1040 case 'demote':1041 case 'ban':1042 case 'unban':1043 $user_group_status = 'member';1044 break;1045 1046 }1047 1048 }1049 1050 // --<1051 return $user_group_status;1052 961 1053 962 } -
bp-groups-civicrm-sync/trunk/includes/civicrm/class-civicrm-group-contact.php
r3147635 r3263514 337 337 $this->register_hooks(); 338 338 339 // Skip ACL Group unless we have a Group Admin or a Group Admin is being demoted. 340 if ( ! in_array( $args['status'], [ 'admin', 'ex-admin' ] ) ) { 339 /* 340 * Skip ACL Group unless we have a Group Admin or a Group Admin is being demoted. 341 * We also need to account for AJAX "Leave Group" requests that cannot be checked 342 * prior to the Group membership being deleted. 343 */ 344 if ( ! in_array( $args['status'], [ 'admin', 'ex-admin' ], true ) ) { 341 345 return $result; 342 346 } -
bp-groups-civicrm-sync/trunk/includes/civicrm/class-civicrm-group-meta.php
r3035828 r3263514 330 330 331 331 // Skip if the parent is not the container Group. 332 if ( ! in_array( (int) $meta_group_id, $group['parents'] ) ) {332 if ( ! in_array( (int) $meta_group_id, $group['parents'], true ) ) { 333 333 continue; 334 334 } -
bp-groups-civicrm-sync/trunk/includes/civicrm/class-civicrm-group.php
r3035828 r3263514 179 179 } 180 180 181 // Maybe assi ngto Meta Group.181 // Maybe assign to Meta Group. 182 182 $this->civicrm->group_nesting->nesting_update( $bp_group->id ); 183 183 … … 1348 1348 1349 1349 // Allow the relevant ones. 1350 if ( in_array( strtolower( $permission ), $permissions ) ) {1350 if ( in_array( strtolower( $permission ), $permissions, true ) ) { 1351 1351 $granted = 1; 1352 1352 } -
bp-groups-civicrm-sync/trunk/includes/wp-cli/commands/command-job.php
r3035828 r3263514 242 242 243 243 // Show feedback each time Group changes. 244 if ( ! in_array( $bp_group_id, $bp_group_ids) ) {244 if ( ! in_array( (int) $bp_group_id, $bp_group_ids, true ) ) { 245 245 246 246 // Try the pseudo-cache for the BuddyPress Group. … … 250 250 WP_CLI::log( sprintf( WP_CLI::colorize( '%gDeleting Contacts not in BuddyPress Group%n %Y%s%n %y(ID: %d)%n' ), $bp_group_data['title'], $bp_group_id ) ); 251 251 252 $bp_group_ids[] = $bp_group_id;252 $bp_group_ids[] = (int) $bp_group_id; 253 253 254 254 } -
bp-groups-civicrm-sync/trunk/languages/bp-groups-civicrm-sync.pot
r3147635 r3263514 1 # Copyright (C) 202 4Christian Wach1 # Copyright (C) 2025 Christian Wach 2 2 # This file is distributed under the GPLv2 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: BP Groups CiviCRM Sync 0.5. 2a\n"5 "Project-Id-Version: BP Groups CiviCRM Sync 0.5.3a\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bp-groups-civicrm-sync\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 4-09-06T15:08:45+00:00\n"12 "POT-Creation-Date: 2025-03-28T12:56:32+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.1 0.0\n"14 "X-Generator: WP-CLI 2.11.0\n" 15 15 "X-Domain: bp-groups-civicrm-sync\n" 16 16 … … 128 128 msgstr "" 129 129 130 #: bp-groups-civicrm-sync.php:3 62130 #: bp-groups-civicrm-sync.php:375 131 131 #: includes/admin/class-page-settings.php:127 132 132 #: includes/admin/class-page-settings.php:130 … … 134 134 msgstr "" 135 135 136 #: bp-groups-civicrm-sync.php:3 66136 #: bp-groups-civicrm-sync.php:379 137 137 msgid "Donate!" 138 138 msgstr "" … … 351 351 352 352 #: includes/civicrm/class-civicrm-group-contact.php:122 353 #: includes/civicrm/class-civicrm-group-contact.php:84 0354 #: includes/civicrm/class-civicrm-group-contact.php:89 4353 #: includes/civicrm/class-civicrm-group-contact.php:844 354 #: includes/civicrm/class-civicrm-group-contact.php:898 355 355 #: includes/civicrm/class-civicrm-group.php:367 356 356 #: includes/civicrm/class-civicrm-group.php:430 -
bp-groups-civicrm-sync/trunk/readme.txt
r3147635 r3263514 4 4 Tags: civicrm, buddypress, user, groups, sync 5 5 Requires at least: 4.9 6 Tested up to: 6. 67 Stable tag: 0.5. 26 Tested up to: 6.8 7 Stable tag: 0.5.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 26 26 ### Requirements 27 27 28 This plugin requires a minimum of *WordPress 4.9*, *BuddyPress 1.8* and *CiviCRM 5.19*. Having the latest version of each plugin active is, of course, highly recommended.28 This plugin requires a minimum of *WordPress 4.9*, *BuddyPress 2.3* and *CiviCRM 5.19*. Having the latest version of each plugin active is, of course, highly recommended. 29 29 30 30 ### Plugin Development … … 44 44 45 45 == Changelog == 46 47 = 0.5.3 = 48 49 * Reworks BuddyPress Group Member logic to use before and after SQL hooks 50 * Accounts for Group Admins leaving via the Groups Directory button 46 51 47 52 = 0.5.2 =
Note: See TracChangeset
for help on using the changeset viewer.