From: priyankakaran26 Date: Sat, 18 Oct 2014 23:33:07 +0000 (+0100) Subject: insert listener shouldn't intercept recursion->generate process X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;ds=sidebyside;h=652903ed038db88f01db6dd1b7685d5af3f7d87f;p=civicrm-core.git insert listener shouldn't intercept recursion->generate process --- diff --git a/CRM/Core/BAO/RecurringEntity.php b/CRM/Core/BAO/RecurringEntity.php index 647ffbc0a2..3e636dd971 100644 --- a/CRM/Core/BAO/RecurringEntity.php +++ b/CRM/Core/BAO/RecurringEntity.php @@ -53,6 +53,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { protected $recursion = NULL; public static $_entitiesToBeDeleted = array(); + + public static $status = NULL; static $_recurringEntityHelper = array( @@ -239,6 +241,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @return array */ function generateEntities() { + self::$status = "Running"; + $newEntities = array(); $findCriteria = array(); if (!empty($this->recursionDates)) { @@ -292,6 +296,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { } } + self::$status = NULL; return $newEntities; } @@ -623,6 +628,11 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { return NULL; } + if (self::$status == 'Running') { + // if recursion->generate() is doing some work, lets not intercept + return NULL; + } + // mark being processed $processedEntities[$key] = 1;