Skip to content

AB#37078 - Phone number truncation#208

Closed
paulmaclean wants to merge 1 commit intomasterfrom
ab37078-customer_portal__including_a_1_before_a_10_digit_phone_number
Closed

AB#37078 - Phone number truncation#208
paulmaclean wants to merge 1 commit intomasterfrom
ab37078-customer_portal__including_a_1_before_a_10_digit_phone_number

Conversation

@paulmaclean
Copy link
Contributor

@paulmaclean paulmaclean commented Aug 27, 2025

This PR takes care of three small Portal UI issues.

Bug 37078: Customer Portal - Including a "1" before a 10 digit phone number will display in the portal with the last digit being truncated

The issue here is that if a user inputs a US phone number on an account with a leading 1, the existing template data mask would malform the number (non US numbers are rendered as-is) My solution here is to simply truncate that leading 1. Another option would be to update the Portal Framework to include the number_formatted field, however I decided that is likely overkill for this edge case.

Bug 36078: Customer Portal > Make a Payment - Country and State/Province revert to U.S.

This was a simple addition of blade's old() template function to retrieve the session data on validation redirects.

Bug 36278: Customer Portal > Clicking submit multiple times adds duplicate bank account payment methods

Required a bit of JS to disable the button on submit.

Copy link

@thrall-s-all-seeing-eye thrall-s-all-seeing-eye bot left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@HellooooNewman HellooooNewman left a comment

Choose a reason for hiding this comment

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

lgtm 👍

Copy link
Contributor

@LarrySonar LarrySonar left a comment

Choose a reason for hiding this comment

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

Needs finer grained country code.

PhoneNumber::FAX => null,
];

$country = SystemSetting::first()->country;
Copy link
Contributor

Choose a reason for hiding this comment

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

This unfortunately will not work as needed. We allow in Sonar each individual number to specify the country which is where we should be getting that from though I am not certain it is getting passed back to the portal for use.

Looking at the card, I would state the "real" problem as the lack of validation in the application. I just tested with: 1339064285555 and it accepted that as well! It then just displayed as an unformatted string with the 1 stripped in the UI.

return utrans("errors.failedToUpdateProfile");
}

private function formatPhoneForDisplay(string $phoneNumber, string $country): string
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Might name this differently as not really doing "formatting" - maybe stripUsCountryCodeForDisplay(...) though not sure if this will be needed once we fix the item above.

@paulmaclean paulmaclean deleted the ab37078-customer_portal__including_a_1_before_a_10_digit_phone_number branch August 28, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants