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

CRM-20973: Fixes "Call to undefined function Civi\API\civicrm_api3_create_error() … #10773

Merged
merged 1 commit into from
Jul 27, 2017

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Jul 27, 2017

… in Civi/API/Kernel.php on line 413"

…eate_error() in Civi/API/Kernel.php on line 413"
@civicrm-builder
Copy link

Can one of the admins verify this patch?

@eileenmcnaughton
Copy link
Contributor

test this please

@eileenmcnaughton
Copy link
Contributor

I'm really mystified about this - if this is an issue why does anything work? Is there anything special about your environment or how you are calling CiviCRM

@seamuslee001
Copy link
Contributor

@eileenmcnaughton looking at the github search for this function where it is called, its called from other places but this is the only place that has a namespace and because civicrm_api3_create_error isn't within that namespace it is looking for a function civicrm_api3_create_error within the namespace and its failing so adding \ takes it back to the root

@eileenmcnaughton
Copy link
Contributor

OK - but it's not new so why has something that would seem catastrophic not been apparent until now?

@seamuslee001
Copy link
Contributor

shrugs shoulders flips tables

@totten
Copy link
Member

totten commented Jul 27, 2017

jenkins, add to whitelist

@dsnopek
Copy link
Contributor Author

dsnopek commented Jul 27, 2017

@eileenmcnaughton Maybe it just took a long time for anyone to notice because it's an error during an error condition? The code that needs the \ is only called when there's an error to create the error object, and this is also an error, so even though a nice error object isn't coming back to the caller, it's still an error when an error should happen.

I haven't done git blame or anything, but I suspect the call to civicrm_api3_create_error() existed before that file had a namespace declaration, and so maybe the error conditions weren't checked that thoroughly after the namespace was added? That's my best random guess :-)

In any case, I doubt it has anything to do with something special in my environment, but I personally encountered the error when installing the civicrm_views module on Drupal 8 which was doing a bad API call on purpose for dubious reasons - see https://issues.civicrm.org/jira/browse/CRM-20974

@eileenmcnaughton
Copy link
Contributor

Oh wow - you just hurt my brain with all those errors in errors. I really wanted to get to the bottom of this - but now I just want to make it go away. Merging!

@eileenmcnaughton eileenmcnaughton merged commit 5eb2555 into civicrm:master Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants