Skip to content

[Candidate Identifier (Rework Part 8)] Add Candidate Identifiers Support to New Profile - #11327

Open
HachemJ wants to merge 7 commits into
aces:mainfrom
HachemJ:AddCandidateIdentifiersNewProfile
Open

HachemJ wants to merge 7 commits into
aces:mainfrom
HachemJ:AddCandidateIdentifiersNewProfile

Conversation

@HachemJ

@HachemJ HachemJ commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Brief summary of changes

This PR adds support for configurable candidate identifiers in the New Profile module, allowing candidate identifiers to be handled when creating new candidate profiles.

Previously, the New Profile module relied on legacy candidate identifier fields. This PR integrates the new Candidate Identifiers functionality into the candidate creation workflow.

Changes

  • Updated the New Profile frontend to support the new candidate identifier structure.
  • Updated the New Profile backend to handle candidate identifiers during candidate creation.
  • Updated the Candidates API endpoint to support candidate identifiers when registering new candidates.
  • Integrated candidate creation with the new Candidate Identifiers functionality.

Testing Instructions

  1. Open the New Profile module.
  2. Create a new candidate and verify that the profile is created successfully.
  3. Verify that candidate identifiers are correctly generated or assigned during candidate creation.
  4. Verify that the identifiers are correctly stored and associated with the new candidate.
  5. Verify that the created candidate can be retrieved through the Candidates API with the expected identifiers.
  6. Create multiple candidates and verify that identifiers are assigned correctly without unintended duplicates.
  7. Verify that the existing New Profile workflow continues to function as expected.

@github-actions github-actions Bot added Language: SQL PR or issue that update SQL code Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code Module: api PR or issue related to api module Module: candidate_parameters PR or issue related to candidate_parameters module Module: configuration PR or issue related to configuration module Module: new_profile PR or issue related to new_profile module Module: dataquery PR or issue related to (new) dataquery module Multilingual Any tasks related to making LORIS multilingual labels Nov 17, 2026
@HachemJ HachemJ added State: Blocked PR or issue awaiting an external event such as the merge or another PR to proceed and removed Language: SQL PR or issue that update SQL code Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code Module: api PR or issue related to api module Module: candidate_parameters PR or issue related to candidate_parameters module Module: configuration PR or issue related to configuration module Module: new_profile PR or issue related to new_profile module Module: dataquery PR or issue related to (new) dataquery module Multilingual Any tasks related to making LORIS multilingual labels Nov 17, 2026
@HachemJ
HachemJ force-pushed the AddCandidateIdentifiersNewProfile branch from ce5cd2f to f7ac8a4 Compare November 17, 2026 14:20
@github-actions github-actions Bot added Language: SQL PR or issue that update SQL code Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code Module: api PR or issue related to api module Module: candidate_parameters PR or issue related to candidate_parameters module Module: configuration PR or issue related to configuration module Module: new_profile PR or issue related to new_profile module Module: dataquery PR or issue related to (new) dataquery module Multilingual Any tasks related to making LORIS multilingual labels Nov 17, 2026
@HachemJ
HachemJ force-pushed the AddCandidateIdentifiersNewProfile branch 8 times, most recently from 4bcb5dc to 20ca1bd Compare November 19, 2026 19:30
@HachemJ
HachemJ marked this pull request as ready for review November 19, 2026 19:34
@HachemJ
HachemJ force-pushed the AddCandidateIdentifiersNewProfile branch from 20ca1bd to 7a3da9d Compare November 19, 2026 19:58

@HenriRabalais HenriRabalais left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HachemJ

thanks for this! Registration on a stock install traces through fine. A few things inline, the main one is the ExternalID being skipped.

Two broader things: this branch still sits on the earlier versions of Parts 4 to 7, so the diff here repeats Part 1 and the old .js files, could you rebase it on the updated stack? And once it's on Part 6, the identifier type checks here could use canAccessIdentifierType from IdentifierTypeController (it takes a Candidate, so registration would need a version that takes the project).

@ridz1208 one design question: if a required identifier type has a permission, users without that permission don't see the field and the API then refuses the registration, so they can't register anyone in that project. Is that what we want?

$project->getId(),
$registrationCohortID
$registrationCohortID,
true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passing true here makes createNew skip ExternalIDGenerator (Candidate.class.inc:435), so with useExternalID turned on, candidates created through New Profile or the API come out without an ExternalID. Should the ExternalID still be generated here?

*
* @return bool Whether the user has access
*/
private function _canAccessIdentifierType(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same permission check as Part 6's canAccessIdentifierType, and new_profile.class.inc does it a third time, could all three use the one method?

);

foreach ($identifierTypes as $type) {
if ($type->name === 'PSCID' && !$type->autoGenerate) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as the PSCID rename on Part 4, this and the checks at :550, :615 and in new_profile.class.inc:103 find PSCID by its name

key={name}
id={name}
name={name}
label={`Generate ${type.Name}`}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this label go through t()?

$PSCIDType = $identifierTypeController->getIdentifierTypeFromName('PSCID');

if (!$PSCIDType->autoGenerate) {
$pscidSet = "true";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could the New Profile help and test plan cover the identifier fields, and the v0.0.4-dev schema add Identifiers to the POST /candidates body?

@HachemJ
HachemJ force-pushed the AddCandidateIdentifiersNewProfile branch from 7a3da9d to c195ac1 Compare November 26, 2026 21:27
@HachemJ

HachemJ commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks again Henri, your feedback is really helpful! I've addressed your comments, rebased the branch onto the updated stack and tested the changes locally.

Ready for another review whenever you have time.

@HachemJ
HachemJ force-pushed the AddCandidateIdentifiersNewProfile branch from c195ac1 to 1c33ca1 Compare November 27, 2026 20:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: Javascript PR or issue that update Javascript code Language: PHP PR or issue that update PHP code Language: SQL PR or issue that update SQL code Module: api PR or issue related to api module Module: candidate_parameters PR or issue related to candidate_parameters module Module: configuration PR or issue related to configuration module Module: dataquery PR or issue related to (new) dataquery module Module: new_profile PR or issue related to new_profile module Multilingual Any tasks related to making LORIS multilingual State: Blocked PR or issue awaiting an external event such as the merge or another PR to proceed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants