-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[user_accounts] Use userID to update examiners table (#7462)
Currently when updating the examiners table in edit_user, it is assumed that a unique examiner exists based on their full name instead of their userID. This causes 2 problems: - If an examiner with the same name as another examiner is edited, the older one will be replaced in the table and will no longer be considered an examiner. I.e. only one examiner can exist per full name. - If a user's name is edited, then a new row will be created in the examiners table and there will be 2 rows for the same user. This fixes this issue by assuming in the user_accounts module that examiners have a unique userID instead of assuming examiners have a unique full name in the user accounts module. However, since examiners do not have to be users, the examiners module was edited to assume that an examiner added is not a user. The examiner module does not ask for any identifying info other than the full name, so it would be impossible to know which user is being referred to if we are accepting that different users may exist with the same name. The resulting implementation is that only one non-user examiner can be added per full name, but any LORIS users that are added as examiners do not have to have a unique name. The instrument library file is also edited to add an email beside the full name in the examiners list examiners with duplicate names. Included is a cleanup script that gets rid of the duplicate userIDs in the examiner table which were added because of a name change in "edit user". A script was not made for adding back examiners that may have been overwritten by a new user with the same name, because there is no way to determine this based on the previous implementation of examiners.
- Loading branch information
1 parent
82b5046
commit 92970de
Showing
8 changed files
with
204 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Note: For projects with duplicate examiners, patch must be run AFTER running | ||
-- tools/single_use/Remove_duplicate_examiners.php | ||
|
||
-- Remove constraint on full name | ||
-- Change userID to be unique | ||
-- Make full name / userID combined unique | ||
ALTER TABLE examiners | ||
DROP INDEX `full_name`, | ||
DROP INDEX `FK_examiners_2`, | ||
ADD UNIQUE KEY `unique_examiner` (`full_name`,`userID`), | ||
ADD UNIQUE KEY `FK_examiners_2` (`userID`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.