-
Notifications
You must be signed in to change notification settings - Fork 175
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
[Tools] Generate Candidate External IDs #7095
Conversation
608bf87
to
0723e14
Compare
0723e14
to
0661eb2
Compare
Is there a reason this script is needed? |
This tool was created for another project to populate missing candidate External IDs. Submitting in case it can be useful to add such tool here too. |
exit(1); | ||
} | ||
|
||
// Get all Candidate with a NULL externalID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incorrect comment
$i = 0; | ||
// Update all candidates with an external ID | ||
foreach ($cands as $cand) { | ||
if (!$reset && $cand['ExternalID'] != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are using a loose operator here !=
instead of !==
which means that this statement will return true for $cand['ExternalID'] = false
, $cand['ExternalID'] = 0
, $cand['ExternalID'] = ""
or $cand['ExternalID'] = NULL
. if this is intentional, I usually recommend using empty()
to be more clear or making sure to add a specific comment justifying the !=
. If this is accidental, please use is_null
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ridz1208 , it's a typo.
Thanks @ridz1208, comments addressed. |
New tool to fill external IDs for all candidates where a NULL value is found.
New tool to fill external IDs for all candidates where a NULL value is found.