Skip to:
Content

BuddyPress.org

Changeset 3472 for trunk/bp-groups.php


Ignore:
Timestamp:
11/21/2010 11:30:57 PM (14 years ago)
Author:
boonebgorges
Message:

Fixes a whole bunch of WP_DEBUG problems with groups and especially group creation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups.php

    r3455 r3472  
    9797            /* When in a single group, the first action is bumped down one because of the
    9898               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;
    101101            array_shift($bp->action_variables);
    102102
     
    990990
    991991    /* 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] ) {
    993993
    994994        unset( $bp->groups->current_create_step );
     
    10091009
    10101010    /* 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 ) )
    10121012        $bp->groups->completed_create_steps = unserialize( stripslashes( $_COOKIE['bp_completed_create_steps'] ) );
    10131013
     
    10291029                bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' );
    10301030            }
    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' ) ) ) {
    10331035                bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' );
    10341036                bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' );
     
    10751077         * holding the information
    10761078         */
    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 ) )
    10781081            $bp->groups->completed_create_steps[] = $bp->groups->current_create_step;
    10791082
     
    11081111                }
    11091112
    1110                 if ( $next ) {
     1113                if ( isset( $next ) ) {
    11111114                    $next_step = $key;
    11121115                    break;
     
    14651468     */
    14661469
    1467     if ( $group_id )
     1470    if ( isset( $group_id ) && $group_id )
    14681471        $group = new BP_Groups_Group( $group_id );
    14691472    else
    14701473        $group = new BP_Groups_Group;
    14711474
    1472     if ( $creator_id )
     1475    if ( isset( $creator_id ) && $creator_id )
    14731476        $group->creator_id = $creator_id;
    14741477    else
Note: See TracChangeset for help on using the changeset viewer.