From: atif-shaikh Date: Fri, 22 Aug 2014 11:05:11 +0000 (+0530) Subject: CRM-15142 - "Strict warning" when Manually executing Scheduled job X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7b60d5b9510d71e87f4c15a3cafa8a559f08cf62;p=civicrm-core.git CRM-15142 - "Strict warning" when Manually executing Scheduled job https://issues.civicrm.org/jira/browse/CRM-15142 --- diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index 2d13edd381..de6f7a1b11 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -327,8 +327,12 @@ SELECT survey.id as id, ); } } - - return $activityTypes[$cacheKey]; + if (!empty($activityTypes[$cacheKey])) { + return $activityTypes[$cacheKey]; + } + else { + return; + } } /** @@ -1052,11 +1056,13 @@ INNER JOIN civicrm_survey survey ON ( activity.source_record_id = survey.id ) * * @return array success message */ - public function releaseRespondent($params) { + public static function releaseRespondent($params) { $activityStatus = CRM_Core_PseudoConstant::activityStatus('name'); $reserveStatusId = array_search('Scheduled', $activityStatus); $surveyActivityTypes = CRM_Campaign_BAO_Survey::getSurveyActivityType(); - $surveyActivityTypesIds = array_keys($surveyActivityTypes); + if (!empty($surveyActivityTypes) && is_array($surveyActivityTypes)) { + $surveyActivityTypesIds = array_keys($surveyActivityTypes); + } //retrieve all survey activities related to reserve action. $releasedCount = 0; diff --git a/CRM/Core/Component.php b/CRM/Core/Component.php index c5c49a6a4f..62f484dcac 100644 --- a/CRM/Core/Component.php +++ b/CRM/Core/Component.php @@ -240,8 +240,12 @@ class CRM_Core_Component { */ static function getComponentID($componentName) { $info = self::_info(); - - return $info[$componentName]->componentID; + if (!empty($info[$componentName])) { + return $info[$componentName]->componentID; + } + else { + return; + } } /** diff --git a/CRM/Event/BAO/ParticipantStatusType.php b/CRM/Event/BAO/ParticipantStatusType.php index 599150ec99..930bfd1e62 100644 --- a/CRM/Event/BAO/ParticipantStatusType.php +++ b/CRM/Event/BAO/ParticipantStatusType.php @@ -119,7 +119,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu * * @return array */ - public function process($params) { + public static function process($params) { $returnMessages = array();