The 'include' statement for template.php (in the 'themes/engines/phptemplate/phptemplate.engine' file) needs a DRUPAL_ROOT in front of it. Otherwise, trying to run this 'include' when the site is installed in a vhost subfolder fails, with a message such as:

Fatal error: Call to undefined function mytheme_customfunction() in /path/to/site/sites/all/modules/custom/custom_module/custom_module.module on line 67

Attached patch fixes this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Version: 7.x-dev » 8.x-dev
Priority: Major » Normal
Status: Needs review » Needs work
Issue tags: +Needs backport to D7

This should be fixed in the latest version.

Jaza’s picture

Status: Needs work » Needs review
FileSize
514 bytes

Patch for latest D8.

Jaza’s picture

Status: Needs review » Needs work

New meta-issue for wider discussion of this issue: #1928072: Bootstrapping Drupal from outside the Drupal root directory

mgifford’s picture

Assigned: Jaza » Unassigned
Issue summary: View changes
Related issues: +#1928072: Bootstrapping Drupal from outside the Drupal root directory
dawehner’s picture

The file check is now done when the Extension is created:

      if (!file_exists(dirname($pathname) . '/' . $filename)) {
        $filename = NULL;
      }
      $extension = new Extension($this->root, $type, $pathname, $filename);

And later in Extension::load()

  public function load() {
    if ($this->filename) {
      include_once $this->root . '/' . $this->getPath() . '/' . $this->filename;
      return TRUE;
    }
    return FALSE;
  }
dawehner’s picture

Version: 8.0.x-dev » 7.x-dev

... So we don't longer need it in d8