From: Coleman Watts Date: Wed, 8 May 2013 20:48:51 +0000 (-0700) Subject: Look before leaping when flushing pseudoconstants CRM-12471 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fa56270d80337e62d93705d39919171740fb6c02;p=civicrm-core.git Look before leaping when flushing pseudoconstants CRM-12471 --- diff --git a/CRM/Campaign/PseudoConstant.php b/CRM/Campaign/PseudoConstant.php index cdd67ca119..5f3920ea8b 100755 --- a/CRM/Campaign/PseudoConstant.php +++ b/CRM/Campaign/PseudoConstant.php @@ -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; + } } } diff --git a/CRM/Case/PseudoConstant.php b/CRM/Case/PseudoConstant.php index 5540c9d5c3..1c2c2e93fc 100644 --- a/CRM/Case/PseudoConstant.php +++ b/CRM/Case/PseudoConstant.php @@ -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; + } } } diff --git a/CRM/Contribute/PseudoConstant.php b/CRM/Contribute/PseudoConstant.php index fc0085ffa6..fe69660b55 100644 --- a/CRM/Contribute/PseudoConstant.php +++ b/CRM/Contribute/PseudoConstant.php @@ -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; + } } /** diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index a0eff17b67..96c5328f15 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -476,7 +476,9 @@ class CRM_Core_PseudoConstant { * */ public static function flush($name) { - self::$$name = NULL; + if (isset(self::$$name)) { + self::$$name = NULL; + } } /** diff --git a/CRM/Event/PseudoConstant.php b/CRM/Event/PseudoConstant.php index e5e45e3b6f..cd7a5ef13a 100644 --- a/CRM/Event/PseudoConstant.php +++ b/CRM/Event/PseudoConstant.php @@ -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; + } } /** diff --git a/CRM/Grant/PseudoConstant.php b/CRM/Grant/PseudoConstant.php index a8d9567600..951ac2d15d 100644 --- a/CRM/Grant/PseudoConstant.php +++ b/CRM/Grant/PseudoConstant.php @@ -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; + } } } diff --git a/CRM/Mailing/PseudoConstant.php b/CRM/Mailing/PseudoConstant.php index 37b079aae9..0a36721210 100644 --- a/CRM/Mailing/PseudoConstant.php +++ b/CRM/Mailing/PseudoConstant.php @@ -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; + } } } diff --git a/CRM/Member/PseudoConstant.php b/CRM/Member/PseudoConstant.php index 08676e56bf..8b50539645 100644 --- a/CRM/Member/PseudoConstant.php +++ b/CRM/Member/PseudoConstant.php @@ -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; + } } } diff --git a/CRM/PCP/PseudoConstant.php b/CRM/PCP/PseudoConstant.php index 15773afaa3..80ac08f512 100644 --- a/CRM/PCP/PseudoConstant.php +++ b/CRM/PCP/PseudoConstant.php @@ -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; + } } }