nicholasmr / obblm

Automatically exported from code.google.com/p/obblm
26 stars 54 forks source link

team creation problem #328

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
A coach is unable to create a team.  It fails here.  I think the problem is
that the $coach_ring is 0, which is a valid ring but which also is FALSE in
this logic.

        if (!in_array($input['f_race_id'], array_keys($raceididx))
        || !($coach_ring = get_alt_col('coaches', 'coach_id',
$input['owned_by_coach_id'], 'ring')) # We use coach's ring later.
        || get_alt_col('teams', 'name', $input['name'], 'team_id')
        || $input['f_did'] != self::T_NO_DIVISION_TIE && $input['f_lid'] !=
get_alt_col('divisions', 'did', $input['f_did'], 'f_lid'))  {
Print "Place number 2";
            return false;
        }

I changed that line to ($coach_ring = get_alt_col('coaches', 'coach_id',
$input['owned_by_coach_id'], 'ring')) === FALSE and it worked for me...

Original issue reported on code.google.com by funnyfin...@hotmail.com on 7 Jan 2010 at 2:12

GoogleCodeExporter commented 9 years ago

Original comment by funnyfin...@hotmail.com on 7 Jan 2010 at 2:33

GoogleCodeExporter commented 9 years ago
The inly problem with that is that get_alt_col() does never return false.
The preferable solution is using isset().
Thanks. See r541.

Original comment by Nimda...@gmail.com on 7 Jan 2010 at 6:00

GoogleCodeExporter commented 9 years ago

Original comment by funnyfin...@hotmail.com on 7 Jan 2010 at 11:57