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

[flag] Fix remaining test_name flag #9486

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion php/libraries/Utility.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,9 @@ class Utility
);
} elseif (!is_null($commentID)) { //get sourcefield using commentid
$instrument = $DB->pselectOne(
"SELECT Test_name FROM flag WHERE CommentID = :cid",
"SELECT Test_name FROM flag
JOIN test_names ON test_names.ID = flag.TestID
WHERE CommentID = :cid",
['cid' => $commentID]
);
$sourcefields = $DB->pselect(
Expand Down
5 changes: 4 additions & 1 deletion tools/data_integrity/data_deletion/delete_timepoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ function deleteTimepoint(
echo "\n###############################################################\n";

$instruments = $DB->pselect(
'SELECT Test_name, CommentID FROM flag WHERE SessionID=:sid',
'SELECT Test_name, CommentID
FROM flag
JOIN test_names ON test_names.ID = flag.TestID
WHERE SessionID=:sid',
['sid' => $sessionID]
);

Expand Down
20 changes: 18 additions & 2 deletions tools/data_integrity_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
{$instrument}
ON
{$instrument}.CommentID = flag.CommentID
LEFT JOIN
test_names
ON
test_names.ID = flag.TestID
WHERE
Test_name = :instrument AND
{$instrument}.CommentID IS NULL
Expand Down Expand Up @@ -80,6 +84,10 @@
SessionID,Test_name,CommentID
FROM
flag
JOIN
test_names
ON
test_names.ID = flag.TestID
WHERE
(
flag.CommentID NOT LIKE 'DDE_%' AND
Expand All @@ -88,10 +96,14 @@
COUNT(*)
FROM
flag test
JOIN
test_names
ON
test_names.ID = flag.TestID
WHERE
test.CommentID NOT LIKE 'DDE_%' AND
flag.SessionID = test.SessionID AND
flag.Test_name = test.Test_name
test_names.Test_name = test.Test_name
) > 1
) OR
(
Expand All @@ -101,10 +113,14 @@
COUNT(*)
FROM
flag test
JOIN
test_names
ON
test_names.ID = flag.TestID
WHERE
test.CommentID LIKE 'DDE_%' AND
flag.SessionID = test.SessionID AND
flag.Test_name = test.Test_name
test_names.Test_name = test.Test_name
) > 1
)
",
Expand Down
4 changes: 3 additions & 1 deletion tools/fix_timepoint_date_problems.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,9 @@ function addInstrument($sessionID, $testName, $loris)

// get CommentID of the newly assigned instrument
$query = "SELECT CommentID FROM flag
WHERE SessionID='$sessionID' AND Test_name='$testName'";
JOIN test_names ON test_names.ID = flag.TestID
WHERE SessionID='$sessionID'
AND Test_name='$testName'";

/*
* add Feedback
Expand Down
Loading