Skip to content

Commit d99acb8

Browse files
committed
#0009381: Executing tests, without platform gives DB error - value out of range
1 parent 43fa29f commit d99acb8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/functions/exec.inc.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ function write_execution(&$db,&$execSign,&$exec_data,&$issueTracker) {
9898
$map_nodeid_array_cfnames[$dummy[$cf_nodeid_pos]][]=$input_name;
9999
}
100100
}
101-
101+
102+
$executedInPlatform = ($execSign->platform_id == -1) ? 0 : $execSign->platform_id;
103+
104+
102105
// Steps Partial Execution Feature
103106
// When writting the execution, we will delete any partial execution
104107
// if the test case version has steps defined.
@@ -109,7 +112,7 @@ function write_execution(&$db,&$execSign,&$exec_data,&$issueTracker) {
109112
$stepsIDSet = array_keys($_REQUEST['step_notes']);
110113
$ctx = new stdClass();
111114
$ctx->testplan_id = $execSign->tplan_id;
112-
$ctx->platform_id = $execSign->platform_id;
115+
$ctx->platform_id = $executedInPlatform;
113116
$ctx->build_id = $execSign->build_id;
114117
$tcaseMgr->deleteStepsPartialExec($stepsIDSet,$ctx);
115118
}
@@ -144,7 +147,7 @@ function write_execution(&$db,&$execSign,&$exec_data,&$issueTracker) {
144147
" execution_ts,notes,tcversion_number,platform_id,execution_duration)".
145148
" VALUES ( {$execSign->build_id}, {$execSign->user_id}, '{$exec_data[$execStatusKey][$tcversion_id]}',".
146149
"{$execSign->tplan_id}, {$tcversion_id},{$db_now},'{$my_notes}'," .
147-
"{$version_number},{$execSign->platform_id}";
150+
"{$version_number},{$executedInPlatform}";
148151

149152
$dura = 'NULL ';
150153
if(isset($exec_data['execution_duration'])) {

0 commit comments

Comments
 (0)