Skip to content

[instrument] fix can't save linst file #9769

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 php/libraries/LorisForm.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ class LorisForm
//double escaping
if (!is_array($newValue)) {
$newValue = htmlspecialchars(
$newValue,
strval($newValue),
ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5,
'UTF-8',
false
Expand Down
24 changes: 23 additions & 1 deletion php/libraries/NDB_BVL_Instrument.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2535,7 +2535,7 @@ abstract class NDB_BVL_Instrument extends NDB_Page
$confirmed = $timepoint->getVisitStatus() === 'Pass' ? 'Y' : 'N';

$set = [
'CandID' => $this->getCandID()->__toString(),
'CandidateID' => $this->getCandidateID(),
'DxEvolutionID' => $dxEvolutionID,
'Diagnosis' => json_encode($diagnosis),
'Confirmed' => $confirmed
Expand Down Expand Up @@ -2643,6 +2643,28 @@ abstract class NDB_BVL_Instrument extends NDB_Page
return $pscid;
}

/**
* Get the candidateID.
*
* @return string|null The candidate's ID.
*/
function getCandidateID(): ?string
{
$db = $this->loris->getDatabaseConnection();
$CommentID = $this->getCommentID();

$id = $db->pselectOne(
"SELECT c.ID FROM flag f
JOIN session s ON (f.SessionID=s.ID)
JOIN candidate c ON c.ID=s.CandidateID
WHERE f.CommentID=:CID",
['CID' => $CommentID]
);
return $id;
}



protected ?CandID $candID = null;
/**
* Get the candidate's CandID
Expand Down
Loading