Background We have had Civicrm running for two years. last week a malicious attack occurred. We had to implement a back up copy taken of our crm on 12th June 2018. All is working except for a custom report called Residential Communities Report.

Issue When clicking on Membership Reports then clicking on Residential Communities Report it throws to a HTTP 500 Error. When looking at the error log it shows the following:

[17-Jun-2018 08:51:09 Australia/Sydney] PHP Fatal error: require_once(): Failed opening required 'CRM/Report/Form/Contact/Residential.php' (include_path='/home/gazzafm/public_html/crm/sites/default/files/civicrm/ext/uk.co.vedaconsulting.membershipchurnchart-master/:/home/gazzafm/public_html/crm/sites/default/files/civicrm/ext/uk.co.vedaconsulting.outlookapi-master/:/home/gazzafm/public_html/crm/sites/default/files/civicrm/ext/uk.org.futurefirst.networks.civipoints-1.0/uk.org.futurefirst.networks.civipoints-1.0/:/home/gazzafm/public_html/crm/sites/default/files/civicrm/ext/org.civicrm.module.cividiscount/:/home/gazzafm/public_html/crm/sites/default/files/civicrm/ext/eu.tttp.civisualize/:/home/gazzafm/public_html/crm/sites/default/files/civicrm/ext/nz.co.fuzion.extendedreport/:.:/home/gazzafm/public_html/crm/sites/all/modules/civicrm:/home/gazzafm/public_html/crm/sites/all/modules/civicrm/packages:.:/home/gazzafm/public_html/crm/sites/all/modules/civicrm:/home/gazzafm/public_html/crm/sites/all/modules/civicrm/packages:/home/gazzafm/public_html/crm/sites/all/modules/c in /home/gazzafm/public_html/crm/sites/all/modules/civicrm/CRM/Core/Controller.php on line 451

A lot of the error seems to also include extensions. We have checked those extensions and they are all working. Not sure why they are included in the error log.

Im including Line 451 from the Controller.php for reference here:

require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

Im not certain why this one report is causing an error. We have checked the paths and the report is registered.

Any ideas would help. I have also included the code around the line 451 if that also helps:

  $ext = CRM_Extension_System::singleton()->getMapper();
  if ($ext->isExtensionClass($className)) {
    require_once $ext->classToPath($className);
  else {
    require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
  $$stateName = new $className($stateMachine->find($className), $action, 'post', $formName);
  if ($title) {
  if ($options) {
  if (property_exists($$stateName, 'urlPath') && isset($_GET[CRM_Core_Config::singleton()->userFrameworkURLVar])) {
    $$stateName->urlPath = explode('/', $_GET[CRM_Core_Config::singleton()->userFrameworkURLVar]);
  $this->addAction($stateName, new HTML_QuickForm_Action_Direct());

  //CRM-6342 -we need kill the reference here,
  //as we have deprecated reference object creation.
  • The implication of the above is that CRM/Report/Form/Contact/Residential.php cannot be found in any of the locations searched - where is that file?
    – user4278
    Commented Jun 18, 2018 at 0:00
  • that file is in that directory and path. the report has been registered and shows up in the membership report screen, when clicked it throws the error. In settings ive even added the absolute path /home/gazzafm/public_html/crm/sites/default/files/civicrm/custom_php/CRM/Report/Form/Contact but nothing is responding Commented Jun 19, 2018 at 11:35
  • I just make the assumption that the class of the report is CRM_Report_Form_Contact_Residential and that the file name is Residential.php. In that case the custom php path is /home/gazzafm/public_html/crm/sites/default/files/civicrm/custom_php and the file must be in the CRM/Report/Form/Contact subdirectory. Commented Jun 19, 2018 at 12:39
  • Thanks for the input Kainuk..ive checked everything and the file is in the directory as you pointed out, i cant for the life of me work out why its still throwing the error. Commented Jun 20, 2018 at 1:52

1 Answer 1


You state that the Residential Communities Report is a custom report. And, indeed, I cannot find it in the list with standard reports. Custom reports can be installed in two ways.

  • In an extension. You could check if all your extensions are restored and enabled.
  • It is put in the Custom PHP directory, that can be configured using civicrm/admin/setting/path . Check this value. Maybe you restored on another file location and this value is incorrect.
  • i checked the paths and they seem fine. One thing i noticed is that the report appears to be registered in the register new report template but the URL field may not be correct. i cant find what the correct url should be. should it be the absolute path? Commented Jun 19, 2018 at 11:28

Your Answer

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

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