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

CRM-20866: Soft credit appearance inconsistent in contribution search #11433

Merged
merged 1 commit into from
Dec 27, 2017

Conversation

octo-happiness
Copy link

@octo-happiness octo-happiness commented Dec 19, 2017

Overview

First search for contributions with field "Contributions OR Soft Credits?" set to "Soft Credits Only" does not show soft credit data. Columns "Soft Credit Amount", "Soft Credit For" and "Soft Credit Type" are empty. Thus, soft credits appear as regular contributions.

Subsequent searches include data for those columns.

Before

contribution_soft_data

After

With this fix all searches for soft credits include that data.

Technical Details

There's a static variable CRM_Contribute_BAO_Query::$_contribOrSoftCredit that causes this inconsistent behaviour. It only works under certain conditions (when form values are already in $_SESSION data during CRM_Contribute_Form_Search::preProcess). I've decided to add additional parameter to CRM_Contribute_BAO_Query::selectorReturnProperties, so that it wouldn't rely on static variable being set beforehand.

I've included a small unit test, which asserts that the soft data fields are added to SELECT statement.


@monishdeb
Copy link
Member

Tested the patch, works fine. Great work @octo-happiness 👍

Merging now.

@monishdeb monishdeb merged commit ae2ea5a into civicrm:master Dec 27, 2017
sluc23 pushed a commit to ixiam/civicrm-core that referenced this pull request Jan 10, 2018
CRM-20866: Soft credit appearance inconsistent in contribution search
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants