0

When attempting to run this:

civix generate:api Invoice Create

It creates an /api/v3/Invoice folder but doesn't create any files. Instead I get the following:

Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /home/ubuntu/civix/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php line 56

Civix works for me otherwise; I can create extensions, pages, etc. Any suggestions?

2

Hit this one last month, and created a bug for it: https://issues.civicrm.org/jira/browse/CRM-16218

Are you using WordPress, by any chance?

  • Yep, it occured for me on Wordpress. – Nicholai May 11 '15 at 12:12
2

As a workaround, you can create manually the Create.php file that contains civicrm_api3_invoice_create()

Check the api/v3 folder in the core for examples (eg. the email one)

As for civix, do you have the latest version? if it's the case, fill a bug on github

  • @Andrew's answer and bug filed match the exact issue I'm having. I looked at the Email Create example, but it calls existing api functions. In this case I'm asking civix to create a new API endpoint in order to expose some custom functions to the CMS, per wiki.civicrm.org/confluence/display/CRMDOC/…. – Nicholai May 11 '15 at 12:24
  • my point was that you don't need civix to create these, you can manually create the file with the right function and it will end up working the same – Xavier May 11 '15 at 13:21
  • Ah, I thought perhaps something special was required for exposing my own api functions, as the wiki said "Note that the parameters and return values must be processed in a particular way (as demonstrated by the auto-generated file)." – Nicholai May 11 '15 at 14:02
  • 1
    nope, but it's expecting the name of the file and location and function within to follow a specific format. Checkout the api/v3 on civi for examples (mail.php for instance for a generic one, assuming you have a dao/bao already) – Xavier May 11 '15 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.