I am getting following error -
PHP Fatal error: require_once(): Failed opening required 'sites/all/modules/contrib/google_appliance/google_appliance.helpers.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/somesite/sites/all/modules/contrib/google_appliance/google_appliance.module on line 9

I am loading Drupal in external PHP script -

define('DRUPAL_ROOT', '/var/www/html/somesite');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

Comments

jadhavdevendra created an issue. See original summary.

jadhavdevendra’s picture

Problem is in the module file where helpers and default theme implementations are loaded using require_once
Current implementation -

<?php
// helpers
require_once(drupal_get_path('module', 'google_appliance') . '/google_appliance.helpers.inc');

// default theme impementations
require_once(drupal_get_path('module', 'google_appliance') . '/theme/google_appliance.theme.inc');

?>

It should be as follows as per documentation at https://api.drupal.org/api/drupal/includes!module.inc/function/module_lo...

<?php
// helpers
require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'google_appliance') . '/google_appliance.helpers.inc');

// default theme impementations
require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'google_appliance') . '/theme/google_appliance.theme.inc');

?>
jadhavdevendra’s picture

jadhavdevendra’s picture

Please incorporate this patch in the subsequent release.