Answers.Body: <p>You state that the <em>Residential Communities Report</em> is a custom report. And, indeed, I cannot find it in the list with standard reports. Custom reports can be installed in two ways.</p>
  
  <ul>
  <li>In an extension. You could check if all your extensions are restored and enabled. </li>
  <li>It is put in the <em>Custom PHP directory</em>, that can be configured using <code>civicrm/admin/setting/path</code> . Check this value. Maybe you restored on another file location and this value is incorrect.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-19T11:28:51.793Z
Answers.Text: 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?
Answers.UserDisplayName: Gary Martin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-18T12:00:48.447Z
Answers.LastActivityDate: 2018-06-18T12:00:48.447Z
Answers.UserDisplayName: Kainuk - CiviCooP
Body: <p><strong>Background</strong>
  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.</p>
  
  <p><strong>Issue</strong>
  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:</p>
  
  <p>[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</p>
  
  <p>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.</p>
  
  <p>Im including Line 451 from the Controller.php for reference here:</p>
  
  <p>require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';</p>
  
  <p>Im not certain why this one report is causing an error. We have checked the paths and the report is registered. </p>
  
  <p>Any ideas would help. I have also included the code around the line 451 if that also helps:</p>
  
  <pre><code>  $ext = CRM_Extension_System::singleton()-&gt;getMapper();
    if ($ext-&gt;isExtensionClass($className)) {
      require_once $ext-&gt;classToPath($className);
    }
    else {
      require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
    }
    $$stateName = new $className($stateMachine-&gt;find($className), $action, 'post', $formName);
    if ($title) {
      $$stateName-&gt;setTitle($title);
    }
    if ($options) {
      $$stateName-&gt;setOptions($options);
    }
    if (property_exists($$stateName, 'urlPath') &amp;&amp; isset($_GET[CRM_Core_Config::singleton()-&gt;userFrameworkURLVar])) {
      $$stateName-&gt;urlPath = explode('/', $_GET[CRM_Core_Config::singleton()-&gt;userFrameworkURLVar]);
    }
    $this-&gt;addPage($$stateName);
    $this-&gt;addAction($stateName, new HTML_QuickForm_Action_Direct());
  
    //CRM-6342 -we need kill the reference here,
    //as we have deprecated reference object creation.
    unset($$stateName);
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-18T00:00:17.123Z
Comments.Text: 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?
Comments.UserDisplayName: user4278
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-19T11:35:54.903Z
Comments.Text: 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
Comments.UserDisplayName: Gary Martin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-19T12:39:25.810Z
Comments.Text: 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.
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-20T01:52:23.723Z
Comments.Text: 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.
Comments.UserDisplayName: Gary Martin
Tags: <php><custom-reports>
Title: PHP Fatal Error on Custom Report
ThreadText: # PHP Fatal Error on Custom Report
  
  (Asked by: username_0 on 2018-06-17)
  
  **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) {
      $$stateName->setTitle($title);
    }
    if ($options) {
      $$stateName->setOptions($options);
    }
    if (property_exists($$stateName, 'urlPath') && isset($_GET[CRM_Core_Config::singleton()->userFrameworkURLVar])) {
      $$stateName->urlPath = explode('/', $_GET[CRM_Core_Config::singleton()->userFrameworkURLVar]);
    }
    $this->addPage($$stateName);
    $this->addAction($stateName, new HTML_QuickForm_Action_Direct());
  
    //CRM-6342 -we need kill the reference here,
    //as we have deprecated reference object creation.
    unset($$stateName);
  
  ```
  
  **Tags:** php, custom-reports
  
  > **Comments:**
  > **username_1**: 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?  
  > **username_0**: 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  
  > **username_2**: 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.  
  > **username_0**: Thanks for the input username_2..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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-06-18. Score: 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.
  
  > **Comments:**
  > **username_0**: 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?  
  
  ---
  
  