Index: branches/5.2.x/units/affiliates/affiliates_event_handler.php =================================================================== diff -u -N -r15103 -r15134 --- branches/5.2.x/units/affiliates/affiliates_event_handler.php (.../affiliates_event_handler.php) (revision 15103) +++ branches/5.2.x/units/affiliates/affiliates_event_handler.php (.../affiliates_event_handler.php) (revision 15134) @@ -1,6 +1,6 @@ Name == 'OnBecomeAffiliate' || $event->Name == 'OnChangePaymentType' ) { return $this->Application->LoggedIn() && $this->Application->ConfigValue('Comm_RegisterAsAffiliate'); @@ -56,7 +56,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( $event->Special == 'user' ) { $event->setEventParam('raise_warnings', 0); @@ -80,7 +80,7 @@ * @param kEvent $event * @return string */ - function generateAffiliateCode(&$event) + function generateAffiliateCode($event) { // accepts 1 - 36 $number_length = 11; @@ -117,7 +117,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -142,7 +142,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -164,8 +164,12 @@ * @param kEvent $event * @return bool */ - function OnStoreAffiliate(&$event) + function OnStoreAffiliate($event) { + if ( defined('IS_INSTALL') && IS_INSTALL ) { + return; + } + $object =& $this->Application->recallObject($event->Prefix . '.-item', null, Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -219,7 +223,7 @@ * @param kEvent $event * @author Alex */ - function OnOrderApprove(&$event) + function OnOrderApprove($event) { $order =& $this->Application->recallObject($event->getEventParam('Order_PrefixSpecial')); /* @var $order OrdersItem */ @@ -299,7 +303,7 @@ * @return void * @access protected */ - protected function OnValidateAffiliate(&$event) + protected function OnValidateAffiliate($event) { if ( $this->Application->GetVar('RegisterAsAffiliate') != 'on' || $event->MasterEvent->status != kEvent::erSUCCESS ) { return; @@ -327,7 +331,7 @@ * * @param kEvent $event */ - function OnRegisterAffiliate(&$event) + function OnRegisterAffiliate($event) { if ( $this->Application->GetVar('RegisterAsAffiliate') != 'on' || $event->MasterEvent->status != kEvent::erSUCCESS ) { return; @@ -367,7 +371,7 @@ * * @param kEvent $event */ - function OnBecomeAffiliate(&$event) + function OnBecomeAffiliate($event) { $object =& $event->getObject( Array('form_name' => 'registration', 'skip_autoload' => true) ); /* @var $object UsersItem */ @@ -392,7 +396,7 @@ * @return void * @access protected */ - protected function OnChangePaymentType(&$event) + protected function OnChangePaymentType($event) { $event->CallSubEvent('OnUpdate'); @@ -420,7 +424,7 @@ * @return void * @access protected */ - protected function OnBeforeDeleteFromLive(kEvent &$event) + protected function OnBeforeDeleteFromLive(kEvent $event) { parent::OnBeforeDeleteFromLive($event); @@ -474,7 +478,7 @@ * @param kEvent $event * @author Alex */ - function OnResetStatistics(&$event) + function OnResetStatistics($event) { if ( defined('IS_INSTALL') && IS_INSTALL ) { return; @@ -574,7 +578,7 @@ * @return void * @access protected */ - protected function iterateItems(kEvent &$event) + protected function iterateItems(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -641,7 +645,7 @@ * @return bool * @access protected */ - protected function checkItemStatus(kEvent &$event) + protected function checkItemStatus(kEvent $event) { if ( $this->Application->isAdminUser ) { return true;