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

[ready for core review] CRM-19153 Fixed future payment dates for future start pledge dates #8785

Merged
merged 11 commits into from
Nov 14, 2016

Conversation

Edzelopez
Copy link
Contributor


@Edzelopez
Copy link
Contributor Author

Could one of the admins please verify this patch?

@eileenmcnaughton
Copy link
Contributor

Can we get a unit test on this? probably in the api_v3_ContributionPageTest class - which is where all the tests are for submitting that form

@@ -934,7 +934,7 @@ public static function processFormContribution(
$pledgeParams['create_date'] = $pledgeParams['start_date'] = $pledgeParams['scheduled_date'] = date("Ymd");
Copy link
Contributor

Choose a reason for hiding this comment

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

@mlutfy @eileenmcnaughton I don't want to cause more work for JMA ;) but shouldn't date formats in reports be drawn from civicrm/admin/setting/date?action=reset=1 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@JoeMurray I think the question is what is the destination once we have formatted the date, In this case here we are in the processFormContribution so most likely we are going to be inserting a date into the DB so need for format it into a date format that the db knows and i think Ymd is common for that. If we are building a form or something public then yes we would need to consider localised date formats. At least that is my thinking but @mlutfy @eileenmcnaughton correct me if i am wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree @seamuslee001

@JoeMurray
Copy link
Contributor

Could you ensure that there are automated tests for every field we added to forms. If the API tests don't included separate tests for each field, please ensure that all new fields are tested for set and get actions.

@JoeMurray
Copy link
Contributor

Also, please fix test errors. Thx.

@Edzelopez Edzelopez changed the title CRM-19153 Fixed future payment dates for future start pledge dates [ready for core review] CRM-19153 Fixed future payment dates for future start pledge dates Sep 1, 2016
@Edzelopez
Copy link
Contributor Author

jenkins, test this please

@Edzelopez Edzelopez force-pushed the CRM-19153 branch 2 times, most recently from dd0568f to e9f772d Compare September 8, 2016 07:00
@Edzelopez
Copy link
Contributor Author

Could one of the admins please verify this?

@@ -518,7 +518,7 @@ public function postProcess() {
'calendar_month' => 'pledge_calendar_month',
);
if ($params['pledge_default_toggle'] == 'contribution_date') {
$fieldValue = json_encode(array('contribution_date' => date('Ymd')));
$fieldValue = json_encode(array('contribution_date' => date('m/d/Y')));
Copy link
Contributor

Choose a reason for hiding this comment

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

This smells a bit to me since there are settings for how dates are formatted. Just because the default format is American m/d/Y doesn't mean this will work in Canada for Ymd or d/m/Y formats. I'm going to see about creating an instance to check this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, this change was made in order to match how CiviCRM saves dates when used from the datepicker. I will check with Pradeep to see if there are any CRM functions I should be using instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JoeMurray
I've checked and it looks good. Like @seamuslee001 mentioned above, this is only to save the current date in the database.

----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
…week

----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
…edge not selected

----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
----------------------------------------
* CRM-19153: Future pledge start date causes improper future pledge payment dates
  https://issues.civicrm.org/jira/browse/CRM-19153
@Edzelopez
Copy link
Contributor Author

Rebased PR. Could one of the admins please verify this patch?

@Edzelopez
Copy link
Contributor Author

@eileenmcnaughton We would like to get these fixes merged as they are critical. I have included test coverage for them in this PR. Is there anything more I should be looking at in terms of date formats and localisation?

@Edzelopez
Copy link
Contributor Author

@monishdeb could you please QA this? Thanks.

@eileenmcnaughton
Copy link
Contributor

Hey, I'm going to work through the RC list in line with the calendar & I'll make sure this is assigned https://calendar.google.com/calendar/embed?src=OTFxaWIwdjE3bnU0b29tOGN2OHZzczlqcDBAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ

@monishdeb
Copy link
Member

@eileenmcnaughton I already assigned on https://docs.google.com/document/d/107kGgGCQnsjPlGQqXUqO2P7u1mfdtnJ8EQ8pq_L7mIo/edit# for QA but not started review, so can I proceed ?

@eileenmcnaughton
Copy link
Contributor

@monishdeb sure don't let me stop you!

@monishdeb
Copy link
Member

cool :D

@Edzelopez
Copy link
Contributor Author

@eileenmcnaughton @monishdeb THANKS!

@monishdeb
Copy link
Member

Tested pledge payments using Authorize.net, and tried on every scenario like :

  1. Changed Date Input format
  2. Future/past recurring start date

Working fine

@monishdeb monishdeb merged commit 439dbd4 into civicrm:master Nov 14, 2016
@pradpnayak pradpnayak deleted the CRM-19153 branch February 22, 2017 10:52
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