-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Override the DrupalBase getUserObject function with a Drupal8/9 compa… #19517
Override the DrupalBase getUserObject function with a Drupal8/9 compa… #19517
Conversation
(Standard links)
|
eda7a01
to
04f001d
Compare
This looks good to me, we've been using the same approach locally in testing this out anyway. |
Merge on pass based on @MikeyMJCO approving |
04f001d
to
578c81f
Compare
What!!! I just went to lunch and you fixed it? I can't even find my hand-clapping emojis before you're done here. Also, any clues about why this fixes it? is it because user_load only gets called from getUserObject and we can just redefine that and ignore user_load? If so, that sounds like a better solution than mine, though I wonder if there are other instances of code out there that call user_load within the civicrm.module. |
It looks like anywhere else D8 or 9 relevant has already been refactored and this was missed (or it worked and there was no urgency :-) ) |
@seamuslee001 I'm curious why our automated testing didn't pick up the deprecation - do we just not have test coverage for this? |
@MikeyMJCO I would say 1) we don't run the standard api_x tests on D8/D9 instances 2) I'm not sure if there are unit tests covering this specific API @MikeyMJCO @adixon in regards to user load There are none in the d8 module it seems https://github.com/civicrm/civicrm-drupal-8/search?q=user_load These are the ones it is finding in core https://github.com/civicrm/civicrm-core/search?q=user_load and for all but the OG bridge (which is not set up for d8 AFAIK) there are replacement Drupal8 files that override those calls found AFAIK |
…tible version
Overview
This fixes an error when trying to use the User v3 API on Drupal 9 as per https://civicrm.stackexchange.com/questions/38766/call-to-undefined-function-user-load-using-drupal-9-and-api3
Before
Undefined function user_load
After
no undefined function
ping @adixon @KarinG @MikeyMJCO @eileenmcnaughton