Skip to content

Commit

Permalink
Fix errors caused by CandidateID refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersoncasimir committed Feb 21, 2025
1 parent a338f24 commit e7dbed0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions modules/imaging_uploader/php/imaging_uploader.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class Imaging_Uploader extends \NDB_Menu_Filter_Form
/////////Validate the advanced Options only if it's not a Phantom//////
///////////////////////////////////////////////////////////////////////
if ($args['values']['IsPhantom']=='N') {
$candid = trim($args['values']['candID']);
$candid = intval(trim($args['values']['candID']));
$pscid = trim($args['values']['pSCID']);
$visit_label = trim($args['values']['visitLabel']);
////////////////////////////////////////////////////////////////
Expand All @@ -329,7 +329,7 @@ class Imaging_Uploader extends \NDB_Menu_Filter_Form
LEFT JOIN candidate c2
ON (c.candid=c2.candid AND c2.pscid = :pid)
LEFT JOIN session s
ON (s.candid=c.candid and s.visit_label = :vlabel)
ON (s.CandidateID=c2.ID and s.visit_label = :vlabel)
WHERE c.candid = :cid",
[
':cid' => $candid,
Expand Down Expand Up @@ -511,7 +511,7 @@ class Imaging_Uploader extends \NDB_Menu_Filter_Form
$pscid = $args['values']['pSCID'];
$pname = $pscid. "_" . $candid . "_" . $visit_label;
$sessionid = $db->pselectOne(
"SELECT ID FROM session s
"SELECT s.ID FROM session s
JOIN candidate c ON c.ID=s.CandidateID
WHERE c.CandID = :cid
AND Visit_label =:vlabel",
Expand Down
14 changes: 10 additions & 4 deletions php/libraries/NDB_BVL_Feedback.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,13 @@ class NDB_BVL_Feedback
'Date_taken' => $today,
'UserID' => $this->_username,
];

$candID = $this->_feedbackCandidateProfileInfo['CandID'];
$candidateID = $DB->pselectOne(
"SELECT ID FROM candidate WHERE CandID=:candID",
['candID' => $candID]
);

if ($level == 'instrument' || $this->_feedbackLevel=='instrument') {
$feedbackInfo =& $this->_feedbackCandidateProfileInfo;

Expand All @@ -721,27 +728,26 @@ class NDB_BVL_Feedback
[
"CommentID" => $this->_feedbackObjectInfo['CommentID'],
"SessionID" => $feedbackInfo['SessionID'],
"CandID" => $feedbackInfo['CandID'],
"CandidateID" => $candidateID,
"Feedback_level" => "instrument",
"FieldName" => $fieldname,
]
);

} elseif ($level == 'visit' || $this->_feedbackLevel=='visit') {
$candID = $this->_feedbackCandidateProfileInfo['CandID'];
$setArray = array_merge(
$setArray,
[
"SessionID" => $this->_feedbackObjectInfo['SessionID'],
"CandID" => $candID,
"CandidateID" => $candidateID,
"Feedback_level" => "visit",
]
);
} elseif ($level == 'profile' || $this->_feedbackLevel=='profile') {
$setArray = array_merge(
$setArray,
[
"CandID" => $this->_feedbackObjectInfo['CandID'],
"CandidateID" => $candidateID,
"Feedback_level" => "profile",
]
);
Expand Down

0 comments on commit e7dbed0

Please sign in to comment.