CRM-15142 - "Strict warning" when Manually executing Scheduled job
authoratif-shaikh <shaikh388@gmail.com>
Fri, 22 Aug 2014 11:05:11 +0000 (16:35 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Fri, 22 Aug 2014 11:05:11 +0000 (16:35 +0530)
https://issues.civicrm.org/jira/browse/CRM-15142

CRM/Campaign/BAO/Survey.php
CRM/Core/Component.php
CRM/Event/BAO/ParticipantStatusType.php

index 2d13edd381b7b5c589f90f8b12e8f425f6b11b2d..de6f7a1b1111b65c614c20900eff3837302ff71b 100644 (file)
@@ -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;
index c5c49a6a4ffee83ceb4c1c77f71f46e4e326768a..62f484dcac43977961ba46ecb140596268996997 100644 (file)
@@ -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;
+    }
   }
 
   /**
index 599150ec9991eb80e3b4c0ed41b89b45326a3dca..930bfd1e622c52ab7c028d60e16971a2230658fe 100644 (file)
@@ -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();