Answers.Body: <p>This does appear to be a legitimate issue, so I've created a bug in the tracker here: <a href="https://issues.civicrm.org/jira/browse/CRM-18079" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-18079</a></p>
  
  <p>Generally it's better <em>not</em> to use this folder for maintainability reasons - it is better to use an extension - but since it is an advertised piece of functionality, it should work as intended!</p>
  
  <p>Thanks for reporting this.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-24T01:34:57.267Z
Answers.Text: Thanks. Is the preferred method to do them as part of a extension?
Answers.UserDisplayName: Patrick Davis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-24T16:54:23.627Z
Answers.Text: Yes indeed, and I've updated the answer to reflect this =]
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-25T17:27:43.303Z
Answers.Text: Thanks. I spent last night converting all mine over to a extension so this wont impact me in the future.
Answers.UserDisplayName: Patrick Davis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-09T17:36:40.353Z
Answers.Text: Is it better to use an extension for overriding core files? Doesn't this mean that there's multiple diffuse locations for functionality? What is two extensions both override the same core file?
Answers.UserDisplayName: JohnFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-11T13:20:39.783Z
Answers.Text: I suppose it depends on the situation. I wonder if there are extensions out there that both override core files, as you mention, but I'm not sure what happens in that situation.
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-22T10:27:08.963Z
Answers.LastActivityDate: 2016-02-24T16:54:11.783Z
Answers.LastEditDate: 2016-02-24T16:54:11.783Z
Answers.UserDisplayName: John
Body: <p>After upgrading to 4.7.2 from 4.6.11 I no longer can load any of my custom_php reports or searches. The custom folder location is not inserted into the include path</p>
  
  <blockquote>
    <p>Fatal error: require_once(): Failed opening required
    'CRM/Report/Form/Member/NWTAByUnit.php'
    (include_path='.:/home/mysite/public_html/test/sites/all/modules/civicrm:/home/mysite/public_html/test/sites/all/modules/civicrm/packages:.:/home/mysite/public_html/test/sites/all/modules/civicrm:/home/mysite/public_html/test/sites/all/modules/civicrm/packages:/home/mysite/public_html/test/sites/all/modules/civicrm/vendor/phpseclib/phpseclib/phpseclib:.:/usr/lib/php:/usr/local/lib/php:/usr/local/php56/lib/php')
    in
    /home/mysite/public_html/test/sites/all/modules/civicrm/CRM/Core/Controller.php
    on line 451</p>
  </blockquote>
  
  <p>The location is set at <code>/home/mysite/public_html/test/sites/all/modules/files/civicrm/custom_php</code></p>
  
  <p>Running Drupal 7.41 and PHP 5.6. Everything else in the upgrade seemed to work fine. All custom data is available and the extensions directory is working correctly.</p>
  
  <p>I've tried to set the path both via the settings files and the web interface. The web interface does accept the path as valid and sets it correctly.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-21T22:42:05.673Z
Comments.Text: Looks like digging through the site files that custom files were never fully implemented into the 4.7 release?
  
  On line 138 of runtime.php I found this:// FIXME
      if (isset($this->customPHPPathDir) && $this->customPHPPathDir) {
        set_include_path($this->customPHPPathDir . PATH_SEPARATOR . get_include_path());
      }
Comments.UserDisplayName: Patrick Davis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-22T00:12:08.293Z
Comments.Text: However $this->customPHPPathDir doesn't exist, nor does it set the custom_tempates directory in the section above.
Comments.UserDisplayName: Patrick Davis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-22T00:29:53.593Z
Comments.Text: In testing, I manually set the two variables for the custom_php and the custom_templates in the runtime.php file and was able to run all my custom files. Are there plans to add back in the separate custom directories? This definitely should be documented somewhere that upgrading to 4.7.2 will break your custom files. I think for now I will avoid the 4.7 upgrade and stay with the LTS version.
Comments.UserDisplayName: Patrick Davis
Tags: <drupal><4.7><custom-reports>
Title: Upgrade to 4.7 breaks custom php
ThreadText: # Upgrade to 4.7 breaks custom php
  
  (Asked by: username_0 on 2016-02-21)
  
  After upgrading to 4.7.2 from 4.6.11 I no longer can load any of my custom\_php reports or searches. The custom folder location is not inserted into the include path
  
  > Fatal error: require\_once(): Failed opening required
  > 'CRM/Report/Form/Member/NWTAByUnit.php'
  > (include\_path='.:/home/mysite/public\_html/test/sites/all/modules/civicrm:/home/mysite/public\_html/test/sites/all/modules/civicrm/packages:.:/home/mysite/public\_html/test/sites/all/modules/civicrm:/home/mysite/public\_html/test/sites/all/modules/civicrm/packages:/home/mysite/public\_html/test/sites/all/modules/civicrm/vendor/phpseclib/phpseclib/phpseclib:.:/usr/lib/php:/usr/local/lib/php:/usr/local/php56/lib/php')
  > in
  > /home/mysite/public\_html/test/sites/all/modules/civicrm/CRM/Core/Controller.php
  > on line 451
  
  The location is set at `/home/mysite/public_html/test/sites/all/modules/files/civicrm/custom_php`
  
  Running Drupal 7.41 and PHP 5.6. Everything else in the upgrade seemed to work fine. All custom data is available and the extensions directory is working correctly.
  
  I've tried to set the path both via the settings files and the web interface. The web interface does accept the path as valid and sets it correctly.
  
  **Tags:** drupal, 4.7, custom-reports
  
  > **Comments:**
  > **username_0**: Looks like digging through the site files that custom files were never fully implemented into the 4.7 release?  On line 138 of runtime.php I found this:// FIXME     if (isset($this->customPHPPathDir) && $this->customPHPPathDir) {       set_include_path($this->customPHPPathDir . PATH_SEPARATOR . get_include_path());     }  
  > **username_0**: However $this->customPHPPathDir doesn't exist, nor does it set the custom_tempates directory in the section above.  
  > **username_0**: In testing, I manually set the two variables for the custom_php and the custom_templates in the runtime.php file and was able to run all my custom files. Are there plans to add back in the separate custom directories? This definitely should be documented somewhere that upgrading to 4.7.2 will break your custom files. I think for now I will avoid the 4.7 upgrade and stay with the LTS version.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-02-22. Score: 5
  
  This does appear to be a legitimate issue, so I've created a bug in the tracker here: <https://issues.civicrm.org/jira/browse/CRM-18079>
  
  Generally it's better *not* to use this folder for maintainability reasons - it is better to use an extension - but since it is an advertised piece of functionality, it should work as intended!
  
  Thanks for reporting this.
  
  > **Comments:**
  > **username_0**: Thanks. Is the preferred method to do them as part of a extension?  
  > **username_1**: Yes indeed, and I've updated the answer to reflect this =]  
  > **username_0**: Thanks. I spent last night converting all mine over to a extension so this wont impact me in the future.  
  > **username_2**: Is it better to use an extension for overriding core files? Doesn't this mean that there's multiple diffuse locations for functionality? What is two extensions both override the same core file?  
  > **username_1**: I suppose it depends on the situation. I wonder if there are extensions out there that both override core files, as you mention, but I'm not sure what happens in that situation.  
  
  ---
  
  