From 763f7a8a11d15285f00f36d9a4f7425187661722 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 14 May 2018 12:57:07 +1200 Subject: [PATCH] Fix leakage of Form entity --- CRM/Member/Form/MembershipConfig.php | 7 ------- CRM/Member/Form/MembershipStatus.php | 18 +++++++++++++++--- CRM/Member/Form/MembershipType.php | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/CRM/Member/Form/MembershipConfig.php b/CRM/Member/Form/MembershipConfig.php index 557023675b..d4b59333cb 100644 --- a/CRM/Member/Form/MembershipConfig.php +++ b/CRM/Member/Form/MembershipConfig.php @@ -53,13 +53,6 @@ class CRM_Member_Form_MembershipConfig extends CRM_Core_Form { */ protected $_BAOName; - /** - * Explicitly declare the entity api name. - */ - public function getDefaultEntity() { - return 'MembershipType'; - } - public function preProcess() { $this->_id = $this->get('id'); $this->_BAOName = $this->get('BAOName'); diff --git a/CRM/Member/Form/MembershipStatus.php b/CRM/Member/Form/MembershipStatus.php index 343e09f8b5..7600d88181 100644 --- a/CRM/Member/Form/MembershipStatus.php +++ b/CRM/Member/Form/MembershipStatus.php @@ -29,16 +29,28 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2018 - * $Id$ - * */ /** * This class generates form components for Membership Type - * */ class CRM_Member_Form_MembershipStatus extends CRM_Member_Form_MembershipConfig { + + /** + * Explicitly declare the entity api name. + */ + public function getDefaultEntity() { + return 'MembershipStatus'; + } + + /** + * Explicitly declare the form context. + */ + public function getDefaultContext() { + return 'create'; + } + /** * Set default values for the form. MobileProvider that in edit/view mode * the default values are retrieved from the database diff --git a/CRM/Member/Form/MembershipType.php b/CRM/Member/Form/MembershipType.php index 135ebb0449..622ffbce26 100644 --- a/CRM/Member/Form/MembershipType.php +++ b/CRM/Member/Form/MembershipType.php @@ -39,6 +39,21 @@ */ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { + + /** + * Explicitly declare the entity api name. + */ + public function getDefaultEntity() { + return 'MembershipType'; + } + + /** + * Explicitly declare the form context. + */ + public function getDefaultContext() { + return 'create'; + } + /** * Max number of contacts we will display for membership-organisation */ -- 2.25.1