*/
public function getPriceSetID(): ?int {
$priceSetID = $this->getSubmittedValue('price_set_id') ?: CRM_Utils_Request::retrieve('priceSetId', 'Integer');
- // Ideally we would use $this->isFormBuilt() here to know when to access the _POST
- // array directly. However, the parent sets isBuilt before, building the form,
- // rather than after.
- if (!$priceSetID && !empty($this->getSubmitValue('price_set_id'))) {
+ if (!$this->isFormBuilt() && !empty($this->getSubmitValue('price_set_id'))) {
return (int) $this->getSubmitValue('price_set_id');
}
return $priceSetID ?? NULL;
* buildQuickForm.
*/
public function buildForm() {
- // @todo - move this to the end of the function - then it can be checked
- // ie $this->isBuilt() to determine whether variables are not yet in getSubmittedValues()
- $this->_formBuilt = TRUE;
-
$this->preProcess();
CRM_Utils_Hook::preProcess(get_class($this), $this);
// it's already been initialized.
self::$_template->ensureVariablesAreAssigned($this->expectedSmartyVariables);
self::$_template->addExpectedTabHeaderKeys();
+ $this->_formBuilt = TRUE;
}
/**