fix: save real tournament id instead of CURRENT tournament
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Sat, 18 Mar 2017 10:01:36 +0000 (11:01 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Sat, 18 Mar 2017 10:05:23 +0000 (11:05 +0100)
web/Obj/dbase_pgsql.phh

index 26dcf35..4aa11de 100644 (file)
@@ -721,7 +721,7 @@ class BriskDB
                 // match not exists, insert it
                 // , BIN5_TOURNAMENT_NO_DRAW
                 $mtc_sql = sprintf("INSERT INTO %sbin5_matches (ttok, tidx, mazzo_next, mult_next, tcode) VALUES ('%s', %d, %d, %d, %d) RETURNING *;",
-                                   $G_dbpfx, $sql_ttok, $tidx, $table->mazzo, $table->mult, BIN5_TOURNAMENT_CURRENT);
+                                   $G_dbpfx, $sql_ttok, $tidx, $table->mazzo, $table->mult, $table->rules->id_get());
                 if (($mtc_pg  = $this->query($mtc_sql)) == FALSE || pg_affected_rows($mtc_pg) != 1) {
                     log_crit(sprintf("bin5_points_save: failed at insert match [%s]", $mtc_sql));
                     break;