Price Field Form: save the fid for the postProcess hook
authorMathieu Lutfy <mathieu@symbiotic.coop>
Tue, 16 Jun 2020 19:57:40 +0000 (15:57 -0400)
committerMathieu Lutfy <mathieu@bidon.ca>
Tue, 16 Jun 2020 21:36:21 +0000 (17:36 -0400)
CRM/Price/Form/Field.php

index 260050d261833e7fb91427033d394086f8848765..571ab77be16ee7158efc542d658b88fa9d98a4c6 100644 (file)
@@ -690,6 +690,8 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     $priceField = CRM_Price_BAO_PriceField::create($params);
 
     if (!is_a($priceField, 'CRM_Core_Error')) {
+      // Required by extensions implementing the postProcess hook (to get the ID of new entities)
+      $this->setEntityId($priceField->id);
       CRM_Core_Session::setStatus(ts('Price Field \'%1\' has been saved.', [1 => $priceField->label]), ts('Saved'), 'success');
     }
     $buttonName = $this->controller->getButtonName();