Skip to content

Commit 155136d

Browse files
authored
[instrument_list] fix can't start visit. (#9678)
Fix can't start visit. Fixes #9648
1 parent 33dfaef commit 155136d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

SQL/0000-00-00-schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ CREATE TABLE `test_battery` (
341341
`CenterID` int(11) default NULL,
342342
`firstVisit` enum('Y','N') default NULL,
343343
`instr_order` tinyint(4) default NULL,
344-
`DoubleDataEntryEnabled` enum('Y','N') default 'N',
344+
`DoubleDataEntryEnabled` enum('Y','N') NOT NULL default 'N',
345345
PRIMARY KEY (`ID`),
346346
KEY `age_test` (`AgeMinDays`,`AgeMaxDays`,`Test_name`),
347347
KEY `FK_test_battery_1` (`Test_name`),
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
UPDATE `test_battery` SET `DoubleDataEntryEnabled`='N' WHERE `DoubleDataEntryEnabled` IS NULL;
2+
ALTER TABLE `test_battery` MODIFY `DoubleDataEntryEnabled` enum('Y','N') NOT NULL DEFAULT 'N';

modules/battery_manager/php/testendpoint.class.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ class TestEndpoint extends \NDB_Page implements RequestHandlerInterface
157157
private function _postInstance(ServerRequestInterface $request)
158158
{
159159
$testArray = json_decode($request->getBody()->getContents(), true);
160-
$test = new Test($this->loris, null, $testArray);
160+
$dde = 'DoubleDataEntryEnabled';
161+
$testArray[$dde] = $testArray[$dde] ?? 'N';
162+
163+
$test = new Test($this->loris, null, $testArray);
161164
$test->row['active'] = 'Y';
162165
return $this->_saveInstance($test, "post");
163166
}

0 commit comments

Comments
 (0)