Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[instrument_list] fix can't start visit. #9678

Merged
merged 4 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ CREATE TABLE `test_battery` (
`CenterID` int(11) default NULL,
`firstVisit` enum('Y','N') default NULL,
`instr_order` tinyint(4) default NULL,
`DoubleDataEntryEnabled` enum('Y','N') default 'N',
`DoubleDataEntryEnabled` enum('Y','N') NOT NULL default 'N',
PRIMARY KEY (`ID`),
KEY `age_test` (`AgeMinDays`,`AgeMaxDays`,`Test_name`),
KEY `FK_test_battery_1` (`Test_name`),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UPDATE `test_battery` SET `DoubleDataEntryEnabled`='N' WHERE `DoubleDataEntryEnabled` IS NULL;
ALTER TABLE `test_battery` MODIFY `DoubleDataEntryEnabled` enum('Y','N') NOT NULL DEFAULT 'N';
5 changes: 4 additions & 1 deletion modules/battery_manager/php/testendpoint.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ class TestEndpoint extends \NDB_Page implements RequestHandlerInterface
private function _postInstance(ServerRequestInterface $request)
{
$testArray = json_decode($request->getBody()->getContents(), true);
$test = new Test($this->loris, null, $testArray);
$dde = 'DoubleDataEntryEnabled';
$testArray[$dde] = $testArray[$dde] ?? 'N';

$test = new Test($this->loris, null, $testArray);
$test->row['active'] = 'Y';
return $this->_saveInstance($test, "post");
}
Expand Down
Loading