/**
* Processing needed for buildForm and later.
+ *
+ * @throws \CiviCRM_API3_Exception
+ * @throws \CRM_Core_Exception
*/
public function preProcess() {
$this->set('searchFormName', 'Search');
}
if ($this->_force) {
+ // Search field metadata is normally added in buildForm but we are bypassing that in this flow
+ // (I've always found the flow kinda confusing & perhaps that is the problem but this mitigates)
+ $this->addSearchFieldMetadata(['Contribution' => CRM_Contribute_BAO_Query::getSearchFieldMetadata()]);
$this->postProcess();
$this->set('force', 0);
}
CRM_Core_Error::deprecatedFunctionWarning('pass receive_date_high not end');
}
$this->_defaults = parent::setDefaultValues();
- if (empty($this->_defaults['contribution_status_id'])) {
+ if (empty($this->_defaults['contribution_status_id']) && !$this->_force) {
+ // In force mode only parameters from the url will be used. When visible/ explicit this is a useful default.
$this->_defaults['contribution_status_id'][1] = CRM_Core_PseudoConstant::getKey(
'CRM_Contribute_BAO_Contribution',
'contribution_status_id',
if (!$this->_force) {
return;
}
+ // Start by loading url defaults.
+ $this->_formValues = $this->setDefaultValues();
$status = CRM_Utils_Request::retrieve('status', 'String');
if ($status) {