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

dev/core#905 Separate contribution_recur status_id option group from contribution option group #14343

Merged
merged 1 commit into from
May 29, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 26, 2019

Overview

No user impact, splits contribution recur status option group from contribution

Before

One option group shared

After

Two separate ones

Technical Details

As we did earlier for pledge status this separates out the option groups - on the basis we have different statuses for the 2 things. In order to ensure we don't break anything
we give the new option group the exact same values as the old one

For new sites I have left off some statuses that I think would not be relevant - Refunded,
Partially Paid, Chargeback, Pending Refund

Comments

@mattwire @monishdeb @pradpnayak @adixon input welcome!

A couple of follow up notes

  1. I think 'In Progress' is now not needed in the contribution_status option group & we might remove from new installs
  2. @mattwire this also solves a problem I hit when trying to make the contribution recur search form metadata driven.
  3. Regarding adding the statuses to add - there were some comments on this PR template but I've removed them from here as the discussion is in gitlab & I will add a follow up PR with them

https://lab.civicrm.org/dev/core/issues/905

@civibot
Copy link

civibot bot commented May 26, 2019

(Standard links)

@civibot civibot bot added the master label May 26, 2019
@eileenmcnaughton eileenmcnaughton changed the title dev/core#905 Separate contribution_recur status_id option group from … dev/core#905 Separate contribution_recur status_id option group from contribution option group May 26, 2019
@seamuslee001
Copy link
Contributor

@eileenmcnaughton don't we need the updated generated_data.sql?

@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 good question - I guess I run setup.sh?

@@ -241,7 +241,7 @@
<import>true</import>
<add>1.6</add>
<pseudoconstant>
<optionGroupName>contribution_status</optionGroupName>
<optionGroupName>contribution_recur_status</optionGroupName>
Copy link
Contributor

Choose a reason for hiding this comment

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

need to run ./bin/setup -g to update the DAO

@eileenmcnaughton
Copy link
Contributor Author

Cool done.

@eileenmcnaughton
Copy link
Contributor Author

test this please

@mattwire
Copy link
Contributor

@eileenmcnaughton Thoughts added to the gitlab issue. Summary: Yes, but we need more thought on the options we provide before merging.

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

@mattwire I've altered this to NOT add the new status. I feel like this would be better merged as a PR that just adds the group & I can follow up & add the statuses. I think we have agreed on them but it feels like a separate PR would be cleaner

@adixon
Copy link
Contributor

adixon commented May 27, 2019

Good idea, for reasons already well noted, and I support the implementation strategy.

I'm only confused about the note about removing the "In Progress" status - are you talking about removing that from the non-recurring payment status?

@eileenmcnaughton
Copy link
Contributor Author

@adixon when I wrote that I believed that 'In Progress' was relevant to pledges & recurring contributions - but not actual contributions. So I thought that with neither of those entities sharing the contribution status option group anymore it would not be needed in that group (I have seem it cause some confusion). However after doing some other stuff in BAO_Contribution yesterday I realise it IS referenced in there for contribution handling so I think I was wrong

@@ -1 +1,11 @@
{* file to handle db changes in 5.15.alpha1 during upgrade *}
--dev/core#905 Add contribution recur status option group
INSERT INTO `civicrm_option_group` ( `name`, {localize field='title'}`title`{/localize}, `is_active` ) VALUES ('contribution_recur_status', {localize}'{ts escape="sql"}Contribution Recur Status{/ts}'{/localize}, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Contribution status option group has is_reserved and is_locked to TRUE, should this option should have same value for those fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pradpnayak yes, thank you - I will fix!

@@ -212,6 +212,7 @@ VALUES
('wysiwyg_presets' , '{ts escape="sql"}WYSIWYG Editor Presets{/ts}' , NULL, 1, 1, 0),
('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , NULL, 1, 1, 0),
('pledge_status' , '{ts escape="sql"}Pledge Status{/ts}' , NULL, 1, 1, 1),
('contribution_recur_status' , '{ts escape="sql"}Recurring Contribution Status{/ts}' , NULL, 1, 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.

Label is different here v/s in upgrade script.

…contribution option group

As we did earlier for pledge status this separates out the option groups - on the basis we have different
statuses for the 2 things. In order to ensure we don't break anything existing the values
we give the new option group the exact same values as the old one>

However, I HAVE added one more value - Processing - which is intended for the period between when
a new contribution starts to be added and when it has been added. This would normally be a few seconds
but when there is an error it would be left in this state - warding off future attempts.

For new sites I have left off some statuses that I think would not be relevant - Refunded,
Partially Paid, Chargeback, Pending Refund
@eileenmcnaughton
Copy link
Contributor Author

@pradpnayak thank you ! I think I've fixed those now

@pradpnayak
Copy link
Contributor

Tested this PR on fresh install and upgrade.
On fresh install - New recurring contribution status option group is created with options

On upgrade - New recurring contribution status option group is created with options of Contribution status copied over.

The options doesn't match on Fresh install v/s upgrade since on fresh install it creates 6 options while during upgrade it creates 10 options(by default contribution statuses). This does make sense inorder to keep the consistency of option.value.

Good to merge.

@eileenmcnaughton
Copy link
Contributor Author

test this please

2 similar comments
@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

test this please

@yashodha
Copy link
Contributor

@eileenmcnaughton : the tests have all passed.
Can this be merged or does it need further inputs/discussions?

@eileenmcnaughton
Copy link
Contributor Author

@yashodha I think it's good to merge - I kept all the stuff that might need discussion for a follow up PR - which I'll do once this is merged

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.

6 participants