Look before leaping when flushing pseudoconstants CRM-12471
authorColeman Watts <coleman@civicrm.org>
Wed, 8 May 2013 20:48:51 +0000 (13:48 -0700)
committerColeman Watts <coleman@civicrm.org>
Wed, 8 May 2013 20:48:51 +0000 (13:48 -0700)
CRM/Campaign/PseudoConstant.php
CRM/Case/PseudoConstant.php
CRM/Contribute/PseudoConstant.php
CRM/Core/PseudoConstant.php
CRM/Event/PseudoConstant.php
CRM/Grant/PseudoConstant.php
CRM/Mailing/PseudoConstant.php
CRM/Member/PseudoConstant.php
CRM/PCP/PseudoConstant.php

index cdd67ca1190a27fb47d1ea115185f9a2a7a7e0f0..5f3920ea8b0f4a228d197bb0898a6f2b553b7294 100755 (executable)
@@ -157,7 +157,9 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+   if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 }
 
index 5540c9d5c36e332045cf7a2f60cfab021dfd7b8b..1c2c2e93fc36330229af95a074195d60c3108b15 100644 (file)
@@ -274,7 +274,9 @@ class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+   if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 }
 
index fc0085ffa61b5e60fd9de4ab40c7ed2c90c6bab9..fe69660b55ab6bb737092c0b73f9fa7f526e9e6c 100644 (file)
@@ -185,7 +185,9 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+   if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 
   /**
index a0eff17b6720b90c4a966990df38d876147ce401..96c5328f15aec24a71a031043110d050ca7e3f63 100644 (file)
@@ -476,7 +476,9 @@ class CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+    if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 
   /**
index e5e45e3b6f9d27306c20b153707b5f9ad217e5b5..cd7a5ef13ae0a9350b89621b14503eafff412463 100644 (file)
@@ -276,7 +276,9 @@ class CRM_Event_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+   if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 
   /**
index a8d95676006871dcac2637d3daa6c41b98109fba..951ac2d15d24d08a8154cd89f500ffd1cca1ab58 100644 (file)
@@ -108,7 +108,9 @@ class CRM_Grant_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+   if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 }
 
index 37b079aae90de0342d8ea5f4b09fa7f06111908e..0a36721210ac5ad891d35391c6b65994a5dea31c 100644 (file)
@@ -240,7 +240,9 @@ class CRM_Mailing_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+   if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 }
 
index 08676e56bf6caefac93944b16a6d5f1fd53c81a3..8b50539645f72d8d21597b5ab1bfd48b32a91ea5 100644 (file)
@@ -126,7 +126,9 @@ class CRM_Member_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+   if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 }
 
index 15773afaa339148412abd39f0b3670c373f01bb3..80ac08f512f1c62f67655a76835e538595100bd0 100644 (file)
@@ -101,7 +101,9 @@ class CRM_PCP_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    */
   public static function flush($name) {
-    self::$$name = NULL;
+   if (isset(self::$$name)) {
+      self::$$name = NULL;
+    }
   }
 }