Cron_email_notification process fails in 4.0

mdsupport wrote on Thursday, April 21, 2011:

After upgrade over the weekend our email notification process stopped working.  The error messages were due to:

Warning: include_once(…/…/interface/globals.php): failed to open stream: No such file or directory in /var/www/openemr/modules/sms_email_reminder/cron_email_notification.php on line 18

Not sure why but the only way to pick up globals.php was after changing to :
include_once(dirname(__FILE__) . “/…/…/interface/globals.php”);

Now the globals.php emits the following :

Session site ID has been set to ‘’

This causes require_once to fail as the site ID is not filed in.

(/var/www/openemr/sites//config.php)

Where should the ‘default’ site be set?

mdsupport wrote on Thursday, April 21, 2011:

The script error is fixed by changing the highlighted line in globals.php :



// Set the site ID if required.  This must be done before any database
// access is attempted.
if (empty($_SESSION) || !empty($_GET)) {
  if (!empty($_GET)) {
    $tmp = $_GET;
  }
  else {
    if (!$ignoreAuth) die(“Site ID is missing from session data!”);
    $tmp = (empty($_SERVER) ? “default” : $_SERVER );
    if (!is_dir($GLOBALS . “/$tmp”)) $tmp = “default”;
  }

A cron initiated job has no HTTP_HOST, so it should default to “default” site.

Hopefully some one will come up with a better solution to or fix the globals.php for future releases.

sunsetsystems wrote on Monday, April 25, 2011:

What’s in the cron script?  Seems like it could invoke something like wget to go through the web server with a suitable URL.

Rod
www.sunsetsystems.com