Changeset 3472 for trunk/bp-groups.php
- Timestamp:
- 11/21/2010 11:30:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r3455 r3472 97 97 /* When in a single group, the first action is bumped down one because of the 98 98 group name, so we need to adjust this and set the group name to current_item. */ 99 $bp->current_item = $bp->current_action;100 $bp->current_action = $bp->action_variables[0];99 $bp->current_item = isset( $bp->current_action ) ? $bp->current_action : false; 100 $bp->current_action = isset( $bp->action_variables[0] ) ? $bp->action_variables[0] : false; 101 101 array_shift($bp->action_variables); 102 102 … … 990 990 991 991 /* If no current step is set, reset everything so we can start a fresh group creation */ 992 if ( ! $bp->groups->current_create_step = $bp->action_variables[1] ) {992 if ( !isset( $bp->action_variables[1] ) || !$bp->groups->current_create_step = $bp->action_variables[1] ) { 993 993 994 994 unset( $bp->groups->current_create_step ); … … 1009 1009 1010 1010 /* Fetch the currently completed steps variable */ 1011 if ( isset( $_COOKIE['bp_completed_create_steps'] ) && ! $reset_steps)1011 if ( isset( $_COOKIE['bp_completed_create_steps'] ) && !isset( $reset_steps ) ) 1012 1012 $bp->groups->completed_create_steps = unserialize( stripslashes( $_COOKIE['bp_completed_create_steps'] ) ); 1013 1013 … … 1029 1029 bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' ); 1030 1030 } 1031 1032 if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'name' => $_POST['group-name'], 'description' => $_POST['group-desc'], 'slug' => groups_check_slug( sanitize_title( esc_attr( $_POST['group-name'] ) ) ), 'date_created' => bp_core_current_time(), 'status' => 'public' ) ) ) { 1031 1032 $new_group_id = isset( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : 0; 1033 1034 if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $new_group_id, 'name' => $_POST['group-name'], 'description' => $_POST['group-desc'], 'slug' => groups_check_slug( sanitize_title( esc_attr( $_POST['group-name'] ) ) ), 'date_created' => bp_core_current_time(), 'status' => 'public' ) ) ) { 1033 1035 bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' ); 1034 1036 bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' ); … … 1075 1077 * holding the information 1076 1078 */ 1077 if ( !in_array( $bp->groups->current_create_step, (array)$bp->groups->completed_create_steps ) ) 1079 $completed_create_steps = isset( $bp->groups->completed_create_steps ) ? $bp->groups->completed_create_steps : array(); 1080 if ( !in_array( $bp->groups->current_create_step, $completed_create_steps ) ) 1078 1081 $bp->groups->completed_create_steps[] = $bp->groups->current_create_step; 1079 1082 … … 1108 1111 } 1109 1112 1110 if ( $next) {1113 if ( isset( $next ) ) { 1111 1114 $next_step = $key; 1112 1115 break; … … 1465 1468 */ 1466 1469 1467 if ( $group_id )1470 if ( isset( $group_id ) && $group_id ) 1468 1471 $group = new BP_Groups_Group( $group_id ); 1469 1472 else 1470 1473 $group = new BP_Groups_Group; 1471 1474 1472 if ( $creator_id )1475 if ( isset( $creator_id ) && $creator_id ) 1473 1476 $group->creator_id = $creator_id; 1474 1477 else
Note: See TracChangeset
for help on using the changeset viewer.