Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-12779

CiviCRM cron does not bootstrap Drupal modules or CiviCRM extensions

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 4.3.3
    • Fix Version/s: None
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When scheduled jobs are called from the CiviCRM-provided cron.php script, no Drupal modules or CiviCRM-native extensions get bootstrapped.

      This causes problems when using CiviMail to send scheduled mailings that include custom tokens in the mailing. If the custom tokens are in either a Drupal module or a CiviCRM-native extension, then the tokens end up blank in the resulting emails.

      If I use the "Administrator ... System Settings ... Scheduled Jobs" area to click the "Execute Now" link, then things work fine because Drupal and the extensions are already bootstrapped.

      But if instead I use the cron job, it fails. ( ie I do a WGET on the URL: http://mygroup.org/sites/all/modules/civicrm/bin/cron.php )

      I solved this issue in my environment by modifying the cron.php file to bootstrap Drupal. The solution is documented at: http://forum.civicrm.org/index.php/topic,28989.0.html

      A related issue (I think) is that this cron.php does not use the same time zone settings as the rest of CiviCRM. ie the timezone is correct if I use "Administrator ... System Settings ... Scheduled Jobs" area to click the "Execute Now" link. But the timezone is wrong if the job is activated from the file:
      http://mygroup.org/sites/all/modules/civicrm/bin/cron.php

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              sgladstone Sarah Gladstone
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: