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

[Tools] Generate Candidate External IDs #7095

Merged
merged 3 commits into from
Nov 25, 2020

Conversation

laemtl
Copy link
Contributor

@laemtl laemtl commented Oct 14, 2020

New tool to fill external IDs for all candidates where a NULL value is found.

@laemtl laemtl requested a review from ridz1208 October 15, 2020 00:08
@laemtl laemtl force-pushed the 2020-10-14-generate-externalID branch from 608bf87 to 0723e14 Compare October 16, 2020 16:27
@laemtl laemtl force-pushed the 2020-10-14-generate-externalID branch from 0723e14 to 0661eb2 Compare October 16, 2020 17:20
@christinerogers christinerogers added the Event: Hacktoberfest 2020 PR or issue accepted for Hacktoberfest 2020 label Oct 29, 2020
@driusan
Copy link
Collaborator

driusan commented Nov 5, 2020

Is there a reason this script is needed?

@laemtl
Copy link
Contributor Author

laemtl commented Nov 5, 2020

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
Copy link
Collaborator

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) {
Copy link
Collaborator

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

https://www.php.net/manual/en/types.comparisons.php

Copy link
Contributor Author

@laemtl laemtl Nov 23, 2020

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.

@laemtl laemtl requested a review from ridz1208 November 23, 2020 17:32
@laemtl
Copy link
Contributor Author

laemtl commented Nov 23, 2020

Thanks @ridz1208, comments addressed.

@driusan driusan merged commit c9086ae into aces:main Nov 25, 2020
@ridz1208 ridz1208 added this to the 24.0.0 milestone Nov 27, 2020
AlexandraLivadas pushed a commit to AlexandraLivadas/Loris that referenced this pull request Jun 29, 2021
New tool to fill external IDs for all candidates where a NULL value is found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Event: Hacktoberfest 2020 PR or issue accepted for Hacktoberfest 2020
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants