Skip to content

Commit

Permalink
Fixes #28 - Cup cannot be started without team/player
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Schulz committed Dec 12, 2018
1 parent 4d924ed commit 4f8fca5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions admin/cup_admin/includes/cup_start_playoffs.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
//
// Bracket zu gross?
$anzTeams = $cupArray['teams']['checked_in'];
if ($anzTeams < 1) {
throw new \Exception($_language->module['no_teams']);
}

if ($anzTeams < 3) {
$setValueArray[] = '`max_size` = 2';
} else if ($anzTeams < 5) {
Expand Down Expand Up @@ -58,10 +62,6 @@
WHERE `cupID` = " . $cup_id
);

if (!$query) {
throw new \Exception($_language->module['error_update_query_failed']);
}

//
// Bracket erstellen
$createBracket = __DIR__ . '/cup_start_playoffs_bracket.php';
Expand All @@ -71,6 +71,9 @@

include($createBracket);

if (!$query) {
throw new \Exception($_language->module['error_update_query_failed']);
}
$_SESSION['successArray'][] = $_language->module['bracket_created'];

$parent_url .= '&page=bracket';
Expand Down

0 comments on commit 4f8fca5

Please sign in to comment.