Skip to content

Commit

Permalink
Ensure that completed status is selected by default on search contrib…
Browse files Browse the repository at this point in the history
…ution form

Use PseudoConstant function as label could change (good point thanks pradeep)
  • Loading branch information
seamuslee001 committed Jun 24, 2019
1 parent 14126be commit 8f8147e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CRM/Contribute/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ public function setDefaultValues() {
CRM_Core_Error::deprecatedFunctionWarning('pass receive_date_high not end');
}
$this->_defaults = parent::setDefaultValues();
if (empty($this->_defaults['contribution_status'])) {
$this->_defaults['contribution_status'][1] = 1;
if (empty($this->_defaults['contribution_status_id'])) {
$this->_defaults['contribution_status_id'][1] = CRM_Core_PseudoConstant::getKey(
'CRM_Contribute_BAO_Contribution',
'contribution_status_id',
'Completed'
);
}
return $this->_defaults;
}
Expand Down

0 comments on commit 8f8147e

Please sign in to comment.