[REF][PHP8.2] Resolve dynamic property usage in CRM_Price_Form_Option
authorBradley Taylor <hello@brad-taylor.co.uk>
Sun, 3 Dec 2023 21:22:20 +0000 (21:22 +0000)
committerBradley Taylor <hello@brad-taylor.co.uk>
Thu, 21 Dec 2023 19:46:52 +0000 (19:46 +0000)
CRM/Price/Form/Option.php

index 3aeecdc00f4c267937560c787b254c7b1ffb3f60..fa66e123230c875ef7f949d0950119015eb21013 100644 (file)
@@ -41,6 +41,13 @@ class CRM_Price_Form_Option extends CRM_Core_Form {
    */
   protected $_moneyFields = ['amount', 'non_deductible_amount'];
 
+  /**
+   * price_set_id being edited
+   *
+   * @var int
+   */
+  protected $_sid;
+
   /**
    * Set variables up before form is built.
    *
@@ -147,7 +154,6 @@ class CRM_Price_Form_Option extends CRM_Core_Form {
       ) {
         $this->_sid = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $this->_fid, 'price_set_id', 'id');
       }
-      $this->isEvent = FALSE;
       $extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'extends', 'id');
       $this->assign('showMember', FALSE);
       if ($this->isComponentPriceOption($extendComponentId, 'CiviMember')) {
@@ -161,7 +167,6 @@ class CRM_Price_Form_Option extends CRM_Core_Form {
       }
       else {
         if ($this->isComponentPriceOption($extendComponentId, 'CiviEvent')) {
-          $this->isEvent = TRUE;
           // count
           $this->add('number', 'count', ts('Participant Count'));
           $this->addRule('count', ts('Please enter a valid Max Participants.'), 'positiveInteger');