From fa56270d80337e62d93705d39919171740fb6c02 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 8 May 2013 13:48:51 -0700 Subject: [PATCH] Look before leaping when flushing pseudoconstants CRM-12471 --- CRM/Campaign/PseudoConstant.php | 4 +++- CRM/Case/PseudoConstant.php | 4 +++- CRM/Contribute/PseudoConstant.php | 4 +++- CRM/Core/PseudoConstant.php | 4 +++- CRM/Event/PseudoConstant.php | 4 +++- CRM/Grant/PseudoConstant.php | 4 +++- CRM/Mailing/PseudoConstant.php | 4 +++- CRM/Member/PseudoConstant.php | 4 +++- CRM/PCP/PseudoConstant.php | 4 +++- 9 files changed, 27 insertions(+), 9 deletions(-) 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; + } } } -- 2.25.1