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#1403 - CRM/Contribute - Change "Date Received" to "Contribution Date" #26145

Merged

Conversation

olayiwola-compucorp
Copy link
Contributor

@olayiwola-compucorp olayiwola-compucorp commented May 3, 2023

Overview

Development work for https://lab.civicrm.org/dev/core/-/issues/1403

This PR updates the Contribution receive_date title/label from Date Received to Contribution Date so it's clear that the date is the contribution date. Also, the receive_date description /commenthas been removed.

Before

The contribution receive_date has the title Date Received or Received.

After

The contribution receive_date title has now been changed to Contribution Date.

e.g.
New/Edit Contribution Screen
image

Contact Contributions
image

Contribution Searckit
image

New Membership Screen
Screenshot 2023-05-05 at 17 07 06

In summary, the changes will affect screens such as the Contribution Import/Export screen which previously used "Date Received" or "Received" as a label for the Contribution "receive_date" field.

@civibot
Copy link

civibot bot commented May 3, 2023

No issue was found matching the number given in the pull request title. Please check the issue number.

@civicrm-builder
Copy link

Can one of the admins verify this patch?

1 similar comment
@civicrm-builder
Copy link

Can one of the admins verify this patch?

@civibot
Copy link

civibot bot commented May 3, 2023

(Standard links)

@civibot civibot bot added the master label May 3, 2023
@larssandergreen
Copy link
Contributor

I have reviewed.
Code changes look good, except we need to update the schema here and then run GenCode.php (see the top info box here) to regenerate the DAO file, rather than editing it directly.
No issues on r-run.

It looks like the consensus in the linked issue was to change the label to "Contribution date" and this changes to "Date", but I think it is clear that it is a contribution date in context and "Contribution date" would be redundant, so that seems better to me.

There are also a lot more places where Received Date or just Received is used. I think it would make sense to update all of those at the same time in this PR.

Wouldn't it make sense to change the descriptions at the same time? Since we're saying this is not, in some cases, actually the receive date, it doesn't really make sense to have a description that says something about the date the contribution was received. I think different orgs are going to use date differently and we shouldn't be trying to describe specific use cases. I'm in favour of removing the description entirely, both the schema comment and where it appears on forms.

@kcristiano
Copy link
Member

I agree @larssandergreen about the approved label change. I think Date is too ambiguous and will cause confusion. I'd have brought this up on the issue had it been simply Date. I think that it needs more clarification. What Date? If Pay Later does this reflect the original Date or the date Payment was received? How does it relate to Transaction Date? I'd rather see this label as Contribution Date and not simply Date.

@magnolia61
Copy link
Contributor

Agree!
"Contribution date" would be a welcome alternative. Just 'date' would be too general

@olayiwola-compucorp olayiwola-compucorp force-pushed the changeContributionDateLabel branch from 98bba95 to a87ebe9 Compare May 5, 2023 16:13
@olayiwola-compucorp olayiwola-compucorp changed the title dev/core#1403 - CRM/Contribute - Change "Date Received" to "Date" dev/core#1403 - CRM/Contribute - Change "Date Received" to "Contribution Date" May 5, 2023
@demeritcowboy
Copy link
Contributor

jenkins test this please

@demeritcowboy
Copy link
Contributor

jenkins retest this please

@demeritcowboy
Copy link
Contributor

Just commenting based on the discussion this would be mergeable, but I haven't merged yet because the tests haven't run and I can't seem to get them to run (note it only says 2 checks have run - those are the style check and test site build, but not the actual unit tests).

I think maybe an admin needs to add to whitelist to get them to run?

@larssandergreen
Copy link
Contributor

I had a quick look and looks good, but there is one "Received" still here and another here, another here, and here, here, some "Received Date" here and here.

There are more, but I'm not able to catalogue them all here right now. So I think perhaps best to wait to merge to make this change in full?

@larssandergreen
Copy link
Contributor

Few more here and here.

There are also a few in the tests here and here that will need to be updated.

There are also two instances of "Received" in civicrm_uf_field in civicrm_data.tpl, which I believe will require changing and adding upgrade SQL to change this in existing installations.

I think that's it.

@seamuslee001
Copy link
Contributor

Jenkins add to whitelist

@olayiwola-compucorp olayiwola-compucorp force-pushed the changeContributionDateLabel branch 3 times, most recently from 8dcdcd1 to d9ad017 Compare May 8, 2023 08:14
@olayiwola-compucorp
Copy link
Contributor Author

Thanks for the review @larssandergreen, The necessary "Received" or "Received Date" fields have all been changed to "Contribution Date".

Except for those in https://github.com/civicrm/civicrm-core/blob/master/sql/civicrm_generated.mysql, running the GenCode script doesn't update them.

@larssandergreen
Copy link
Contributor

To update civicrm_generated.mysql, you need to run bin/regen.sh.

But when you update civicrm_data.tpl, you also need to update this data on existing installations (since this file is only used on install), which you do by adding SQL in CRM/Upgrade/Incremental/sql/5.63.alpha1.mysql.tpl (you can see samples of this in upgrades for past versions in the same folder).

@demeritcowboy
Copy link
Contributor

Note when you run regen.sh it will then fail unrelated tests because a recent membership wording change was merged that needs some tests updated first.

It's a bit messy right now.

Note you can also run regen online in your fork: see https://github.com/civicrm/civicrm-core/blob/master/.github/workflows/regen.yml

@olayiwola-compucorp olayiwola-compucorp force-pushed the changeContributionDateLabel branch 4 times, most recently from 45c6f4f to 75b45d5 Compare May 9, 2023 13:09
@@ -12,3 +12,6 @@ INSERT IGNORE INTO civicrm_navigation
VALUES
( {$domainID}, 'https://docs.civicrm.org/user/?src=iam', '{ts escape="sql" skip="true"}User Guide{/ts}', 'User Guide', NULL, 'AND', @adminHelplastID, '1', NULL, 1 ),
( {$domainID}, 'https://civicrm.org/help?src=iam', '{ts escape="sql" skip="true"}Get Help{/ts}', 'Get Help', NULL, 'AND', @adminHelplastID, '1', NULL, 2 );

{* https://github.com/civicrm/civicrm-core/pull/26145 *}
UPDATE civicrm_uf_field SET label = '{ts escape="sql"}Contribution Date{/ts}' WHERE field_name = 'receive_date';
Copy link
Contributor

Choose a reason for hiding this comment

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

The test is failing because this would need to be done in php and accounting for multilingual where the field is called label_enUS, etc, like in FiveThirtyOne.php. But I think it would also be ok to leave it out so we can get this merged.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
UPDATE civicrm_uf_field SET label = '{ts escape="sql"}Contribution Date{/ts}' WHERE field_name = 'receive_date';
{if $multilingual}
{foreach from=$locales item=locale}
UPDATE IGNORE civicrm_uf_field SET label_{$locale} = '{ts escape="sql"}Contribution Date{/ts}' WHERE field_name = 'receive_date';
{/foreach}
{else}
UPDATE IGNORE civicrm_uf_field SET label = '{ts escape="sql"}Contribution Date{/ts}' WHERE field_name = 'receive_date';
{/if}

Sorry, I should have thought to mention that. This should do the job. It still works in SQL, @demeritcowboy?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean, it does work, I tested it. But there's no specific reason we can't still use SQL here, is what I meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@larssandergreen, thanks for the suggestion it looks good, is it okay to commit?
or do we want to leave it as it is?

Copy link
Contributor

Choose a reason for hiding this comment

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

It can't be left as is, and now there is also a merge conflict. Either sql or php but also it should only change it if the current label is Date Received, otherwise it will overwrite someone's preferred wording if they already changed it in the profile.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @olayiwola-compucorp it's still failing tests since this is the same code as before. Can I suggest leaving this out and then we can merge the rest? You can always put up another PR after.

@magnolia61
Copy link
Contributor

Would this also change the name of the token? from {contribution.receive_date} to {contribution.date}
I think that would be consistent, could not find that change but maybe I overlooked

@olayiwola-compucorp
Copy link
Contributor Author

@magnolia61 This change wouldn't affect the name of the token, that would require making changes to the schema.

This PR only changes the label/title the field name still remains as receive_date

@olayiwola-compucorp olayiwola-compucorp force-pushed the changeContributionDateLabel branch from 75b45d5 to 10dde3e Compare May 12, 2023 06:09
@olayiwola-compucorp olayiwola-compucorp force-pushed the changeContributionDateLabel branch from 10dde3e to 395314f Compare May 15, 2023 07:33
@demeritcowboy demeritcowboy merged commit 1ac5220 into civicrm:master May 15, 2023
@demeritcowboy
Copy link
Contributor

Yay.

@olayiwola-compucorp Can you make a PR to add yourself to contributor-key.yml for release notes credit?

@olayiwola-compucorp
Copy link
Contributor Author

Thanks @demeritcowboy, done #26225

@jamienovick
Copy link

Great job @olayiwola-compucorp and a big thank you to everyone on this ticket who has got this over the line. One small change for civi, a giant leap for civi-kind!

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.

8 participants