Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1046564
D112.id252.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jun 28, 8:44 PM
Size
24 KB
Mime Type
text/x-diff
Expires
Sun, Jun 29, 8:44 PM (3 h, 40 m)
Engine
blob
Format
Raw Data
Handle
676583
Attached To
D112: INP-1462 - Simplify "kEvent" class constructor
D112.id252.diff
View Options
Index: core/kernel/application.php
===================================================================
--- core/kernel/application.php
+++ core/kernel/application.php
@@ -2082,20 +2082,14 @@
}
/**
- * Allows to process any type of event
+ * Allows to process any type of event.
+ *
+ * @param kEvent $event Event.
*
- * @param kEvent $event
- * @param Array $params
- * @param Array $specific_params
* @return void
- * @access public
*/
- public function HandleEvent($event, $params = null, $specific_params = null)
+ public function HandleEvent(kEvent $event)
{
- if ( isset($params) ) {
- $event = new kEvent($params, $specific_params);
- }
-
$this->EventManager->HandleEvent($event);
}
Index: core/kernel/db/db_tag_processor.php
===================================================================
--- core/kernel/db/db_tag_processor.php
+++ core/kernel/db/db_tag_processor.php
@@ -83,8 +83,7 @@
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial() . '_view_filter');
if ( $view_filter === false ) {
- $event_params = Array ('prefix' => $this->Prefix, 'special' => $this->Special, 'name' => 'OnRemoveFilters');
- $this->Application->HandleEvent(new kEvent($event_params));
+ $this->Application->HandleEvent(new kEvent($this->getPrefixSpecial() . ':OnRemoveFilters'));
$view_filter = $this->Application->RecallVar($this->getPrefixSpecial() . '_view_filter');
}
Index: core/kernel/utility/event.php
===================================================================
--- core/kernel/utility/event.php
+++ core/kernel/utility/event.php
@@ -12,439 +12,442 @@
* See http://www.in-portal.org/license for copyright notices and details.
*/
- defined('FULL_PATH') or die('restricted access!');
+defined('FULL_PATH') or die('restricted access!');
- final class kEvent extends kBase {
+final class kEvent extends kBase
+{
- /**
- * Event finished working succsessfully
- *
- */
- const erSUCCESS = 0;
-
- /**
- * Event finished working, but result is unsuccsessfull
- *
- */
- const erFAIL = -1;
-
- /**
- * Event experienced FATAL error - no hooks should continue!
- *
- */
- const erFATAL = -2;
-
- /**
- * Event failed on internal permission checking (user has no permission)
- *
- */
- const erPERM_FAIL = -3;
-
- /**
- * Event requested to stop processing (don't parse templates)
- *
- */
- const erSTOP = -4;
-
- /**
- * Reference to event, that created given event
- *
- * @var kEvent
- * @access public
- */
- public $MasterEvent;
-
- /**
- * Event name
- *
- * @var string
- * @access public
- */
- public $Name;
-
- /**
- * Don't execute hooks, before event processing
- *
- * @var bool
- * @access public
- */
- public $SkipBeforeHooks = false;
-
- /**
- * Don't execute hooks, after event processing
- *
- * @var bool
- * @access public
- */
- public $SkipAfterHooks = false;
-
- /**
- * Perform redirect after event processing.
- * Redirect after event processing allows to prevent same event being present in resulting url.
- * Also could contain template name, that needs to be shown after redirect.
- *
- * @var mixed
- * @access public
- */
- public $redirect = true;
-
- /**
- * Params, used during redirect url building after event successful processing
- *
- * @var bool
- * @access private
- */
- private $redirectParams = Array ();
-
- /**
- * PHP file to redirect to. Defaults to "index.php"
- *
- * @var string
- * @access public
- */
- public $redirectScript = null;
-
- /**
- * Event processing status
- *
- * @var int
- * @access public
- */
- public $status = kEvent::erSUCCESS;
-
- /**
- * Event parameters
- * Usually indicate, how particular event should be processed.
- *
- * @var Array
- * @access private
- */
- private $specificParams = Array ();
-
- /**
- * Pseudo class used, to create object, based on event contents
- *
- * @var string
- * @access private
- */
- private $pseudoClass = '';
-
- /**
- * Create event from given prefix, special, name and specific params.
- * Parameter $params could be be an an array with following keys: "prefix", "special" (optional), "name".
- * Parameter $params could be a string in format: "prefix:name" or "prefix.special:name".
- *
- * @param mixed $params Params.
- * @param array $specific_params Event specific params (none by default).
- *
- * @throws InvalidArgumentException When incorrect event string given.
- */
- public function __construct($params = Array(), $specific_params = null)
- {
- parent::__construct();
-
- if ( $params ) {
- if ( is_array($params) ) {
- $prefix = isset($params['prefix']) ? $params['prefix'] : false;
- $special = isset($params['special']) ? $params['special'] : false;
-
- if ( $prefix ) {
- $this->Init($prefix, $special);
- }
-
- $this->Name = isset($params['name']) ? $params['name'] : '';
- }
- elseif ( is_string($params) ) {
- if ( preg_match('/([^.:]*)[.]{0,1}([^:]*):(.*)/', $params, $regs) ) {
- $prefix = $regs[1];
- $special = $regs[2];
-
- if ( $prefix ) {
- $this->Init($prefix, $special);
- }
-
- $this->Name = $regs[3];
- }
- else {
- $error_msg = 'Invalid event string: "<strong>' . $params . '</strong>". ';
- $error_msg .= 'Should be in "prefix[.special]:OnEvent" format';
- throw new InvalidArgumentException($error_msg);
- }
- }
- }
+ /**
+ * Event finished working successfully.
+ */
+ const erSUCCESS = 0;
+
+ /**
+ * Event finished working, but result is unsuccessful.
+ */
+ const erFAIL = -1;
+
+ /**
+ * Event experienced FATAL error - no hooks should continue!
+ */
+ const erFATAL = -2;
+
+ /**
+ * Event failed on internal permission checking (user has no permission).
+ */
+ const erPERM_FAIL = -3;
+
+ /**
+ * Event requested to stop processing (don't parse templates).
+ */
+ const erSTOP = -4;
+
+ /**
+ * Reference to event, that created given event.
+ *
+ * @var self
+ */
+ public $MasterEvent;
+
+ /**
+ * Event name.
+ *
+ * @var string
+ */
+ public $Name;
+
+ /**
+ * Don't execute hooks, before event processing.
+ *
+ * @var boolean
+ */
+ public $SkipBeforeHooks = false;
+
+ /**
+ * Don't execute hooks, after event processing.
+ *
+ * @var boolean
+ */
+ public $SkipAfterHooks = false;
+
+ /**
+ * Perform redirect after event processing.
+ *
+ * Redirect after event processing allows to prevent same event being
+ * present in resulting url. Also could contain template name, that
+ * needs to be shown after redirect.
+ *
+ * @var mixed
+ */
+ public $redirect = true;
+
+ /**
+ * Params, used during redirect url building after event successful processing.
+ *
+ * @var array
+ */
+ private $_redirectParams = array();
+
+ /**
+ * PHP file to redirect to. Defaults to "index.php".
+ *
+ * @var string
+ */
+ public $redirectScript = null;
+
+ /**
+ * Event processing status.
+ *
+ * @var integer
+ */
+ public $status = self::erSUCCESS;
+
+ /**
+ * Event parameters.
+ *
+ * Usually indicate, how particular event should be processed.
+ *
+ * @var array
+ */
+ private $_specificParams = array();
+
+ /**
+ * Pseudo class used, to create object, based on event contents.
+ *
+ * @var string
+ */
+ private $_pseudoClass = '';
+
+ /**
+ * Creates an event from array.
+ *
+ * @param array $params Event string in array format with 'prefix', 'special' (optional) and 'name' keys.
+ * @param array $specific_params Specific params.
+ *
+ * @return self
+ */
+ public static function fromArray(array $params, array $specific_params = array())
+ {
+ $prefix = isset($params['prefix']) ? $params['prefix'] : false;
+ $special = isset($params['special']) ? $params['special'] : false;
+ $name = isset($params['name']) ? $params['name'] : '';
- if ( isset($specific_params) ) {
- $this->specificParams = $specific_params;
- }
- }
+ return new self($prefix . '.' . $special . ':' . $name, $specific_params);
+ }
- /**
- * Returns joined prefix and special if any
- *
- * @param bool $from_submit if true, then joins prefix & special by "_", uses "." otherwise
- * @return string
- * @access public
- */
- public function getPrefixSpecial($from_submit = false)
- {
- if (!$from_submit) {
- return parent::getPrefixSpecial();
- }
+ /**
+ * Create event from given prefix, special, name and specific params.
+ * Parameter $params could be be an an array with following keys: "prefix", "special" (optional), "name".
+ * Parameter $params could be a string in format: "prefix:name" or "prefix.special:name".
+ *
+ * @param mixed $event_string Params.
+ * @param array $specific_params Event specific params (none by default).
+ *
+ * @throws InvalidArgumentException When incorrect event string given.
+ */
+ public function __construct($event_string, array $specific_params = array())
+ {
+ parent::__construct();
+
+ if ( preg_match('/([^.:]*)[.]{0,1}([^:]*):(.*)/', $event_string, $regs) ) {
+ $prefix = $regs[1];
+ $special = $regs[2];
+
+ if ( $prefix ) {
+ $this->Init($prefix, $special);
+ }
+
+ $this->Name = $regs[3];
+ $this->_specificParams = $specific_params;
+ }
+ else {
+ $error_msg = 'Invalid event string: "<strong>' . $event_string . '</strong>". ';
+ $error_msg .= 'Should be in "prefix[.special]:OnEvent" format';
+ throw new InvalidArgumentException($error_msg);
+ }
+ }
- return rtrim($this->Prefix . '_' . $this->Special, '_');
+ /**
+ * Returns joined prefix and special if any.
+ *
+ * @param boolean $from_submit If true, then joins prefix & special by "_", uses "." otherwise.
+ *
+ * @return string
+ */
+ public function getPrefixSpecial($from_submit = false)
+ {
+ if ( !$from_submit ) {
+ return parent::getPrefixSpecial();
}
- /**
- * Sets event parameter
- *
- * @param string $name
- * @param mixed $value
- * @access public
- */
- public function setEventParam($name,$value)
- {
- $this->specificParams[$name] = $value;
- }
-
- /**
- * Returns event parameter by name (supports digging)
- *
- * @param string $name
- * @return mixed
- * @access public
- */
- public function getEventParam($name)
- {
- $args = func_get_args();
+ return rtrim($this->Prefix . '_' . $this->Special, '_');
+ }
+
+ /**
+ * Sets event parameter.
+ *
+ * @param string $name Name.
+ * @param mixed $value Value.
+ *
+ * @return void
+ */
+ public function setEventParam($name, $value)
+ {
+ $this->_specificParams[$name] = $value;
+ }
- if (count($args) > 1) {
- kUtil::array_unshift_ref($args, $this->specificParams);
+ /**
+ * Returns event parameter by name (supports digging).
+ *
+ * @param string $name Name.
+ *
+ * @return mixed
+ */
+ public function getEventParam($name)
+ {
+ $args = func_get_args();
- return call_user_func_array('getArrayValue', $args); // getArrayValue($this->specificParams, $name);
- }
+ if ( count($args) > 1 ) {
+ kUtil::array_unshift_ref($args, $this->_specificParams);
- return array_key_exists($name, $this->specificParams) ? $this->specificParams[$name] : false;
+ return call_user_func_array('getArrayValue', $args);
}
- /**
- * Returns all event parameters
- *
- * @return Array
- * @access public
- */
- public function getEventParams()
- {
- return $this->specificParams;
- }
-
- /**
- * Set's pseudo class that differs from
- * the one specified in $Prefix
- *
- * @param string $appendix
- * @access public
- */
- public function setPseudoClass($appendix)
- {
- $this->pseudoClass = $this->Prefix . $appendix;
- }
-
- /**
- * Performs event initialization
- * Also sets pseudo class same $prefix
- *
- * @param string $prefix
- * @param string $special
- * @access public
- */
- public function Init($prefix, $special)
- {
- $this->pseudoClass = $prefix;
-
- parent::Init($prefix, $special);
- }
-
- /**
- * Returns object used in event
- *
- * @param Array $params
- * @return kDBBase
- * @access public
- */
- public function getObject(array $params = Array())
- {
- if ( !$this->Application->hasObject($this->prefixSpecial) ) {
- $top_event = $this;
-
- // when OnSave calls OnPreSave in first line, then this would make sure OnSave is used
- while ( is_object($top_event->MasterEvent) ) {
- $top_event = $top_event->MasterEvent;
- }
+ return array_key_exists($name, $this->_specificParams) ? $this->_specificParams[$name] : false;
+ }
- $params['parent_event'] = $top_event;
+ /**
+ * Returns all event parameters.
+ *
+ * @return array
+ */
+ public function getEventParams()
+ {
+ return $this->_specificParams;
+ }
+
+ /**
+ * Set's pseudo class that differs from the one specified in $Prefix.
+ *
+ * @param string $appendix Appendix.
+ *
+ * @return void
+ */
+ public function setPseudoClass($appendix)
+ {
+ $this->_pseudoClass = $this->Prefix . $appendix;
+ }
+
+ /**
+ * Performs event initialization.
+ *
+ * Also sets pseudo class same $prefix.
+ *
+ * @param string $prefix Prefix.
+ * @param string $special Special.
+ *
+ * @return void
+ */
+ public function Init($prefix, $special)
+ {
+ $this->_pseudoClass = $prefix;
+
+ parent::Init($prefix, $special);
+ }
+
+ /**
+ * Returns object used in event.
+ *
+ * @param array $params Params.
+ *
+ * @return kDBBase
+ */
+ public function getObject(array $params = array())
+ {
+ if ( !$this->Application->hasObject($this->prefixSpecial) ) {
+ $top_event = $this;
+
+ // When OnSave calls OnPreSave in first line, then this would make sure OnSave is used.
+ while ( is_object($top_event->MasterEvent) ) {
+ $top_event = $top_event->MasterEvent;
}
- return $this->Application->recallObject($this->prefixSpecial, $this->pseudoClass, $params);
+ $params['parent_event'] = $top_event;
}
- /**
- * Executes given event in context of current event
- * Sub-event gets this event in "kEvent::MasterEvent" attribute.
- * Sub-event execution results (status and redirect* properties) are copied back to current event.
- *
- * @param string $name name of callable event (optionally could contain prefix_special as well)
- * @see kEvent::MasterEvent
- * @todo Will overwrite master event data with called event data, which makes 'parent_event' useless in most cases
- */
- public function CallSubEvent($name)
- {
- if ( strpos($name, ':') === false ) {
- // PrefixSpecial not specified -> use from current event
- $name = $this->getPrefixSpecial() . ':' . $name;
- }
+ return $this->Application->recallObject($this->prefixSpecial, $this->_pseudoClass, $params);
+ }
- $child_event = new kEvent($name);
- $child_event->copyFrom($this, true);
+ /**
+ * Executes given event in context of current event.
+ *
+ * Sub-event gets this event in "kEvent::MasterEvent" attribute.
+ * Sub-event execution results (status and redirect* properties) are copied back to current event.
+ *
+ * @param string $name Name of callable event (optionally could contain prefix_special as well).
+ *
+ * @return void
+ * @see kEvent::MasterEvent
+ * @todo Overwrites master event data with called event data, which makes 'parent_event' useless in most cases.
+ */
+ public function CallSubEvent($name)
+ {
+ if ( strpos($name, ':') === false ) {
+ // PrefixSpecial not specified -> use from current event.
+ $name = $this->getPrefixSpecial() . ':' . $name;
+ }
+
+ $child_event = new kEvent($name);
+ $child_event->copyFrom($this, true);
+
+ $this->Application->HandleEvent($child_event);
+ $this->copyFrom($child_event);
+ $this->_specificParams = $child_event->_specificParams;
+ }
- $this->Application->HandleEvent($child_event);
- $this->copyFrom($child_event);
- $this->specificParams = $child_event->specificParams;
- }
-
- /**
- * Allows to copy data between events
- *
- * @param kEvent $source_event
- * @param bool $inherit
- * @access public
- */
- public function copyFrom($source_event, $inherit = false)
- {
- if ( $inherit ) {
- $this->MasterEvent = $source_event;
- }
- else {
- $this->status = $source_event->status;
- }
+ /**
+ * Allows to copy data between events.
+ *
+ * @param kEvent $source_event Source event.
+ * @param boolean $inherit Keep reference to source event in copied event.
+ *
+ * @return void
+ */
+ public function copyFrom(kEvent $source_event, $inherit = false)
+ {
+ if ( $inherit ) {
+ $this->MasterEvent = $source_event;
+ }
+ else {
+ $this->status = $source_event->status;
+ }
+
+ $this->redirect = $source_event->redirect;
+ $this->_redirectParams = $source_event->_redirectParams;
+ $this->redirectScript = $source_event->redirectScript;
+ $this->_specificParams = $source_event->_specificParams;
+ }
- $this->redirect = $source_event->redirect;
- $this->redirectParams = $source_event->redirectParams;
- $this->redirectScript = $source_event->redirectScript;
- $this->specificParams = $source_event->specificParams;
- }
-
- /**
- * Returns all redirect parameters
- *
- * @return Array
- * @access public
- */
- public function getRedirectParams()
- {
- return $this->redirectParams;
- }
-
- /**
- * Returns redirect parameter
- *
- * @param string $name
- * @return mixed
- * @access public
- */
- public function getRedirectParam($name)
- {
- return array_key_exists($name, $this->redirectParams) ? $this->redirectParams[$name] : false;
- }
-
- /**
- * Set's redirect param for event
- *
- * @param string $name
- * @param string $value
- * @access public
- */
- public function SetRedirectParam($name, $value)
- {
- $this->redirectParams[$name] = $value;
- }
-
- /**
- * Allows to merge passed redirect params hash with existing ones
- *
- * @param Array $params
- * @param bool $append
- * @access public
- */
- public function setRedirectParams($params, $append = true)
- {
- if ( $append ) {
- // append new parameters to parameters set before
- $params = kUtil::array_merge_recursive($this->redirectParams, $params);
- }
+ /**
+ * Returns all redirect parameters.
+ *
+ * @return array
+ */
+ public function getRedirectParams()
+ {
+ return $this->_redirectParams;
+ }
- $this->redirectParams = $params;
- }
+ /**
+ * Returns redirect parameter.
+ *
+ * @param string $name Name.
+ *
+ * @return mixed
+ */
+ public function getRedirectParam($name)
+ {
+ return array_key_exists($name, $this->_redirectParams) ? $this->_redirectParams[$name] : false;
+ }
- /**
- * Allows to tell if this event was called some how (e.g. subevent, hook) from event requested
- *
- * @param string $event_key event key in format [prefix[.special]:]event_name
- * @return bool
- * @access public
- */
- public function hasAncestor($event_key)
- {
- if ( strpos($event_key, ':') === false ) {
- $event_key = $this->getPrefixSpecial() . ':' . $event_key;
- }
+ /**
+ * Set's redirect param for event.
+ *
+ * @param string $name Name.
+ * @param string $value Value.
+ *
+ * @return void
+ */
+ public function SetRedirectParam($name, $value)
+ {
+ $this->_redirectParams[$name] = $value;
+ }
- return $this->Application->EventManager->eventRunning($event_key);
+ /**
+ * Allows to merge passed redirect params hash with existing ones.
+ *
+ * @param array $params Params.
+ * @param boolean $append Append to existing parameters.
+ *
+ * @return void
+ */
+ public function setRedirectParams(array $params, $append = true)
+ {
+ if ( $append ) {
+ $params = kUtil::array_merge_recursive($this->_redirectParams, $params);
}
- /**
- * Returns permission section associated with event
- *
- * @return string
- * @access public
- */
- public function getSection()
- {
- $perm_section = $this->getEventParam('PermSection');
+ $this->_redirectParams = $params;
+ }
- if ( $perm_section ) {
- return $perm_section;
- }
+ /**
+ * Allows to tell if this event was called some how (e.g. sub-event, hook) from event requested.
+ *
+ * @param string $event_key Event key in format: "[prefix[.special]:]event_name".
+ *
+ * @return boolean
+ */
+ public function hasAncestor($event_key)
+ {
+ if ( strpos($event_key, ':') === false ) {
+ $event_key = $this->getPrefixSpecial() . ':' . $event_key;
+ }
- // 1. get section by current top_prefix
- $top_prefix = $this->getEventParam('top_prefix');
+ return $this->Application->EventManager->eventRunning($event_key);
+ }
- if ( $top_prefix == false ) {
- $top_prefix = $this->Application->GetTopmostPrefix($this->Prefix, true);
- $this->setEventParam('top_prefix', $top_prefix);
- }
+ /**
+ * Returns permission section associated with event.
+ *
+ * @return string
+ * @throws Exception When permission section not specified for event's unit.
+ */
+ public function getSection()
+ {
+ $perm_section = $this->getEventParam('PermSection');
- $section = $this->Application->getUnitConfig($top_prefix)->getPermSectionByName('main');
+ if ( $perm_section ) {
+ return $perm_section;
+ }
- // 2. check if this section has perm_prefix mapping to other prefix
- $sections_helper = $this->Application->recallObject('SectionsHelper');
- /* @var $sections_helper kSectionsHelper */
+ // 1. get section by current top_prefix.
+ $top_prefix = $this->getEventParam('top_prefix');
- $section_data =& $sections_helper->getSectionData($section);
+ if ( $top_prefix == false ) {
+ $top_prefix = $this->Application->GetTopmostPrefix($this->Prefix, true);
+ $this->setEventParam('top_prefix', $top_prefix);
+ }
- if ( $section_data && isset($section_data['perm_prefix']) && $section_data['perm_prefix'] != $top_prefix ) {
- $this->setEventParam('top_prefix', $section_data['perm_prefix']);
- $section = $this->Application->getUnitConfig($section_data['perm_prefix'])->getPermSectionByName('main');
- }
+ $section = $this->Application->getUnitConfig($top_prefix)->getPermSectionByName('main');
- if ( !$section ) {
- throw new Exception('Permission <strong>section</strong> not specified for prefix <strong>' . $top_prefix . '</strong>');
- }
+ // 2. check if this section has perm_prefix mapping to other prefix.
+ $sections_helper = $this->Application->recallObject('SectionsHelper');
+ /* @var $sections_helper kSectionsHelper */
- return $section;
+ $section_data =& $sections_helper->getSectionData($section);
+
+ if ( $section_data && isset($section_data['perm_prefix']) && $section_data['perm_prefix'] != $top_prefix ) {
+ $this->setEventParam('top_prefix', $section_data['perm_prefix']);
+ $section = $this->Application->getUnitConfig($section_data['perm_prefix'])->getPermSectionByName('main');
}
- public function __toString()
- {
- return $this->getPrefixSpecial() . ':' . $this->Name;
+ if ( !$section ) {
+ $error_msg = 'Permission <strong>section</strong> not specified for';
+ $error_msg .= ' prefix <strong>' . $top_prefix . '</strong>';
+ throw new Exception($error_msg);
}
+
+ return $section;
}
+
+ /**
+ * Casts object to string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getPrefixSpecial() . ':' . $this->Name;
+ }
+
+}
Index: core/units/priorites/priority_eh.php
===================================================================
--- core/units/priorites/priority_eh.php
+++ core/units/priorites/priority_eh.php
@@ -245,7 +245,7 @@
/* @var $priority_helper kPriorityHelper */
foreach ($del as $del_info) {
- $dummy_event = new kEvent( array('prefix'=>$del_info['prefix'], 'name'=>'Dummy' ) );
+ $dummy_event = new kEvent($del_info['prefix'] . ':OnDummy');
$ids = $priority_helper->recalculatePriorities($dummy_event, $del_info['constrain'], $del_info['joins']);
if ($ids) {
@@ -299,7 +299,7 @@
function OnChangePriority($event)
{
$prefix = $this->Application->GetVar('priority_prefix');
- $dummy_event = new kEvent( array('prefix'=>$prefix, 'name'=>'Dummy' ) );
+ $dummy_event = new kEvent($prefix . ':OnDummy');
$ids = $this->StoreSelectedIDs($dummy_event);
Index: modules/in-commerce/units/orders/orders_event_handler.php
===================================================================
--- modules/in-commerce/units/orders/orders_event_handler.php
+++ modules/in-commerce/units/orders/orders_event_handler.php
@@ -3552,7 +3552,8 @@
foreach ($cloned_order_ids as $order_id) {
$order->Load($order_id);
- $this->Application->HandleEvent($complete_event, $event->Prefix.'.recurring:OnCompleteOrder' );
+ $complete_event = new kEvent($event->Prefix . '.recurring:OnCompleteOrder');
+ $this->Application->HandleEvent($complete_event);
if ($complete_event->status == kEvent::erSUCCESS) {
//send recurring ok email
Event Timeline
Log In to Comment