Use correct user variable in hook_user_insert #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
$user is never defined anywhere.
It ends up not making a difference when creating drupal users via UI because the only thing it changes in synchronizeUFMatch is that it reassigns $uniqId (the email address) to $params['email'] a second time before calling Contact.create. i.e. once here and then again here.
The Drupal vs Drupal8 also doesn't make a difference because that param is only used when it's wordpress or joomla.
This surfaced because of civicrm/civicrm-core#23515. There aren't any tests in this repo but there are tests elsewhere that failed, e.g. https://github.com/SemperIT/CiviCARROT/runs/6566995948?check_suite_focus=true#step:19:44, where the drupal user isn't created in the UI.