1

I created an extension module with civix then cd'd to the module directory and tried to create a custom report based on a copy of an existing report. I used the following command:

$ civix generate:report --copy CRM_Report_Form_Case_Summary DemandCaseReport CiviCase

This generates an error message that I haven't yet been able to fix.

Initialize report CRM_Case_Form_Report_DemandCaseReport


[RuntimeException]                                      
Booted CiviCRM, but failed to find 'api/class.api.php'  


generate:report [--webPath [WEBPATH]] [--copy [COPY]] [--] <<ClassName>> <<CiviComponent>>

I'm using civix version v16.03.2-3-geeff5c0. It's a WordPress installation.

I can see that a file with that name resides in /wp-content/plugins/civicrm/civicrm/api/class.api.php

Is there an environment variable that I should be setting or something else that I'm overlooking?

Grateful for any tips, thanks.

5
  • which version of civicrm and wordpress are you using ? Aug 9, 2016 at 8:40
  • WP 4.3 civicrm 4.5.8 Aug 9, 2016 at 11:34
  • I did manage to create same report against Civi 4.6.10 and everything went alright with just one warning - is their anyway you can test the same against 4.6.10 Aug 9, 2016 at 11:37
  • I upgraded to 4.6.20 but I'm afraid I got exactly the same error. :( BTW I'm using WP 4.5.3, not 4.3. Sorry about that. Aug 11, 2016 at 21:24
  • It appears that civix is ignoring or overwriting my modifications of the include_path. I added the full path name /Applications/MAMP/htdocs/xxx/civcrm/wp-content/plugins/civicrm/civicrm (where api resides) to include_path in the php.ini (checked I got the right one with php --ini). That didn't work. But I got it to work by soft linking the api directory into the extension directory (changed directory to the extension directory and did the following command: $ ln -s /Applications/MAMP/htdocs/xxx/civcrm/wp-content/plugins/civicrm/civicrm/api . Aug 12, 2016 at 9:34

1 Answer 1

0

It appears that civix is ignoring or overwriting additions to or modifications of the include_path. I added the full path name /Applications/MAMP/htdocs/xxx/civcrm/‌​wp-content/plug‌​ins/civicrm/‌​civicrm (where api resides) to include_path in the php.ini (checked I got the right one with php --ini). That didn't work.

But I got it to work by soft linking the api directory into the new extension directory, i.e. changed directory to the extension directory and did the following command: $ ln -s /Applications/MAMP/htdocs/xxx/civcrm/‌​wp-content/plug‌​ins/civicrm/‌​civicrm/api .

It's not an ideal solution but it enabled meet move forward.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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