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

Use default country as standard #7017

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

respencer
Copy link
Contributor

Description & Issue number it closes

Resolves #5986

Screenshots (if appropriate)

None.

How to test the changes?

Visual inspection.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Visual inspection.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@respencer respencer requested a review from a team as a code owner May 8, 2024 11:01
@respencer respencer requested review from DawoudIO, grayeul, DAcodedBEAT and MrClever and removed request for a team May 8, 2024 11:01

if ($sCountry == 'United States' || $sCountry == 'Canada') {
if ($sCountry == $sDefaultCountry) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this logic might be wrong.

I believe you might want to do something like this instead so the application can check if it has state/province information - https://github.com/ChurchCRM/CRM/blob/master/src/Include/StateDropDown.php#L14-L20

Copy link
Contributor

Choose a reason for hiding this comment

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

Seeing that this code is reused, it might be a good idea to move this logic to a function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The logic is wrong, but not for the reason you gave.

This would only work if everyone in the church was in the same country. Although that will mostly be true, it wont be true all the time.

src/CartToFamily.php Outdated Show resolved Hide resolved
$sState = '';
if ($sCountryTest == 'United States' || $sCountryTest == 'Canada') {
if ($sCountryTest == $sDefaultCountry) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you might want to do something like this instead so the application can check if it has state/province information - https://github.com/ChurchCRM/CRM/blob/master/src/Include/StateDropDown.php#L14-L20

@@ -903,7 +904,7 @@ class="form-control">
<div class="form-group col-md-2">
<label><?= gettext('None State') ?>:</label>
<input type="text" name="StateTextbox"
value="<?php if ($sPhoneCountry != 'United States' && $sPhoneCountry != 'Canada') {
value="<?php if ($sPhoneCountry != $sDefaultCountry) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should be the inverse of the previous check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previous check you commented on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This section needs to be looked at again; "None State" is daft.

src/Reports/CanvassReports.php Outdated Show resolved Hide resolved
src/Reports/ConfirmLabels.php Show resolved Hide resolved
src/Reports/NewsLetterLabels.php Show resolved Hide resolved
src/Reports/TaxReport.php Show resolved Hide resolved
src/Reports/TaxReport.php Show resolved Hide resolved
@respencer respencer force-pushed the 5986-use-default-country-as-standard branch from e090877 to 75ad907 Compare May 10, 2024 06:35
@DAcodedBEAT DAcodedBEAT added this to the vNext (5.9.0) milestone May 10, 2024
@DAcodedBEAT DAcodedBEAT force-pushed the 5986-use-default-country-as-standard branch from b43dc1d to 7a46906 Compare May 13, 2024 14:09
@respencer respencer linked an issue May 14, 2024 that may be closed by this pull request
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also need to check on relationship to #1729

@respencer respencer force-pushed the 5986-use-default-country-as-standard branch from bbcaefd to c8bff8e Compare May 17, 2024 14:42
@respencer
Copy link
Contributor Author

The requested changes have opened a big can of worms (and rabbit holes). It's going to still take some time to resolve this properly.

@respencer respencer force-pushed the 5986-use-default-country-as-standard branch from c8bff8e to 370ee62 Compare May 18, 2024 09:44
@respencer respencer marked this pull request as draft May 18, 2024 09:44
@respencer respencer force-pushed the 5986-use-default-country-as-standard branch from 370ee62 to 5fbac88 Compare May 22, 2024 18:31
@respencer respencer force-pushed the 5986-use-default-country-as-standard branch 2 times, most recently from 98f4865 to 8a6d30d Compare May 28, 2024 07:43
@respencer respencer force-pushed the 5986-use-default-country-as-standard branch 3 times, most recently from 43718ab to be440a5 Compare June 14, 2024 16:53
@respencer respencer force-pushed the 5986-use-default-country-as-standard branch from be440a5 to d7ea297 Compare June 14, 2024 16:57
@DawoudIO DawoudIO modified the milestones: 5.9.0, vNext (5.10.0) Jun 15, 2024
Copy link
Contributor

github-actions bot commented Aug 9, 2024

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Aug 9, 2024
@DAcodedBEAT DAcodedBEAT removed the Stale label Aug 26, 2024
@DAcodedBEAT DAcodedBEAT removed this from the vNext (5.10.1) milestone Sep 25, 2024
@DAcodedBEAT
Copy link
Contributor

@respencer do you still plan on working on this?

Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Nov 11, 2024
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.

USA Addresses not handled correctly in non-USA installations Incorrect representation of"None State"
3 participants