CRM-14106 - Fix treating object as array
authorColeman Watts <coleman@civicrm.org>
Fri, 24 Jan 2014 06:22:28 +0000 (22:22 -0800)
committerColeman Watts <coleman@civicrm.org>
Fri, 24 Jan 2014 06:22:28 +0000 (22:22 -0800)
CRM/Core/Component.php

index 1bb5569b0ffce6c17603c2a26a2b5c4e4e13bab2..9c76095969f50500f0e620f1c8bf5ccbfaf0bf65 100644 (file)
@@ -308,12 +308,15 @@ class CRM_Core_Component {
     return CRM_Core_DAO::$_nullObject;
   }
 
+  /**
+   * FIXME: This function does not appear to do anything. The is_array() check runs on a bunch of objects and (always?) returns false
+   */
   static function &taskList() {
     $info = self::_info();
 
     $tasks = array();
     foreach ($info as $name => $value) {
-      if (!empty($info[$name]['task'])) {
+      if (is_array($info[$name]) && isset($info[$name]['task'])) {
         $tasks += $info[$name]['task'];
       }
     }