Fix leakage of Form entity
authoreileen <emcnaughton@wikimedia.org>
Mon, 14 May 2018 00:57:07 +0000 (12:57 +1200)
committereileen <emcnaughton@wikimedia.org>
Mon, 14 May 2018 01:06:40 +0000 (13:06 +1200)
CRM/Member/Form/MembershipConfig.php
CRM/Member/Form/MembershipStatus.php
CRM/Member/Form/MembershipType.php

index 557023675bd4cec404156b25b58b7b57c876fb56..d4b59333cbdaa88902f54343bee0f23d304571c3 100644 (file)
@@ -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');
index 343e09f8b532484721f35fd2cbad03f29d3ca306..7600d881818a5a5e1c0f77af79589ab413670bec 100644 (file)
  *
  * @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
index 135ebb0449413c249fb29c917b1708ce7f39ab9f..622ffbce2657aefce6bdbfd65e163b4115f60ad3 100644 (file)
  */
 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
    */