Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that completed status is selected by default on search contrib… #14612

Conversation

seamuslee001
Copy link
Contributor

…ution form

Overview

This fixes a small bug where when loading the contribution form the status field doesn't have a default of completed status.

Before

contribution_search_change_pre

After

contribution_search_change_post

ping @eileenmcnaughton @monishdeb @mattwire

@civibot
Copy link

civibot bot commented Jun 23, 2019

(Standard links)

@civibot civibot bot added the master label Jun 23, 2019
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] = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded?

$this->_defaults['contribution_status_id'][1] = CRM_Core_PseudoConstant::getKey(
  'CRM_Contribute_BAO_Contribution',
  'contribution_status_id',
  'Completed'
);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pradpnayak good point have changed to the PseudoConstant

@seamuslee001 seamuslee001 force-pushed the fix_contribution_status_default_search_form branch from 2dafc3b to cf98098 Compare June 23, 2019 20:59
@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 I guess that makes sense but note that - #14624 changes it to not kick in under force

@seamuslee001
Copy link
Contributor Author

@eileenmcnaughton i think that is ok but i would appreciate others thoughts re the force side of things

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 from my testing the force is keeping the old behaviour - ie try going from manage contribution page to the contributions from that page this month in an older version - I think it is not enforcing a status

…ution form

Use PseudoConstant function as label could change (good point thanks pradeep)
@seamuslee001 seamuslee001 force-pushed the fix_contribution_status_default_search_form branch from cf98098 to 8f8147e Compare June 24, 2019 04:14
@seamuslee001 seamuslee001 merged commit 08fa8c6 into civicrm:master Jun 24, 2019
@eileenmcnaughton eileenmcnaughton deleted the fix_contribution_status_default_search_form branch June 24, 2019 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants