- Issue created by @malcomio
- ๐ฎ๐ณIndia sidharth_soman Bangalore
I've added the additional constraint. Please test and review.
- First commit to issue fork.
- last update
over 1 year ago Build Successful - @suryabhi opened merge request.
- last update
over 1 year ago Build Successful - last update
over 1 year ago Build Successful - last update
over 1 year ago Build Successful - last update
over 1 year ago Build Successful - last update
over 1 year ago Build Successful - Status changed to Needs work
over 1 year ago 4:19pm 25 July 2023 - ๐ง๐ชBelgium tim-diels Belgium ๐ง๐ช
Whatโs the difference between the patches and the MR?
Also it would be nice to provide an interdigital or explanation why you post a changed patch.
It is counter productive now and takes time to analyse what is going on. What patch does need review or is it the MR? If patches become obsolete, you can hide them.
So please go through the patches and MR and provide some feedback what is going on.
- ๐ฎ๐ณIndia suryabhi
Patches is against the alpha version while Merge request is against the dev branch. Previously i was created patch from dev branch and codebase is on alpha version so it was not getting applied thats why i have created patch from alpha branch and now it is working.
@tim-diels - Open on Drupal.org โCore: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
over 1 year ago Not currently mergeable. - @suryabhi opened merge request.
- last update
over 1 year ago CI aborted - @suryabhi opened merge request.
- ๐ฎ๐ณIndia suryabhi
I tried different approach in the recent. Kindly review
- Status changed to Needs review
over 1 year ago 10:41am 26 July 2023 - last update
over 1 year ago Build Successful - last update
over 1 year ago PHPLint Failed - last update
over 1 year ago Patch Failed to Apply The last submitted patch, 5: 3376601-3.patch, failed testing. View results โ
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- last update
over 1 year ago CI aborted - last update
over 1 year ago CI aborted - Status changed to Downport
over 1 year ago 5:14am 27 July 2023 - Status changed to Fixed
over 1 year ago 6:03am 27 July 2023 - Status changed to Needs work
over 1 year ago 6:33am 27 July 2023 - ๐ง๐ชBelgium tim-diels Belgium ๐ง๐ช
Am I missing something here? Why is this set as fixed? And still very chaotic communication. Please try to not open 2 MRโs and have so many patches without providing info what is changed.
@malcomio can you help with what is correct here?
- Status changed to Needs review
over 1 year ago 12:59pm 3 August 2023 - ๐ฌ๐งUnited Kingdom malcomio
No need to review the patches - they don't relate to the dev branch.
The two merge requests are alternative approaches:
MR 8 - uses $this->context->addViolation
MR 10 - uses $form_state->setErrorIn our implementation we encountered issues with the
addViolation
approach, where the errors were displaying twice (although that may have been because of some code in a custom module).To me, it seems cleaner to use addViolation, as this is consistent with the rest of the module.
- Open on Drupal.org โCore: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Status changed to Needs work
over 1 year ago 12:23pm 22 August 2023 - ๐ง๐ชBelgium tim-diels Belgium ๐ง๐ช
Sorry for the more work, but needs rebasing.
- Open on Drupal.org โCore: 10.0.7 + Environment: PHP 8.1 & MySQL 8last update
over 1 year ago Waiting for branch to pass - Status changed to Needs review
over 1 year ago 6:13am 24 August 2023 - ๐บ๐ธUnited States chrisolof
Looking at our existing validation it certainly seems like adding a call out to \libphonenumber\PhoneNumberUtil::isValidNumber() would duplicate existing, earlier checks that validate the entered number against the chosen country. I must be missing something. Could you provide more detail on how to reproduce the issue that this addition resolves?
- ๐ฌ๐งUnited Kingdom malcomio
One example where we found that this patch was needed was when a user selected India, then entered "999" as the phone number, they did not see any error message.
The function in the library is documented at https://github.com/giggsey/libphonenumber-for-php/blob/master/src/PhoneN... - there aren't many examples in the tests there, but one is +33 6 76 83 51 85 for Germany
- ๐บ๐ธUnited States chrisolof
Wow. That is a problem. Thank you for catching this. I am re-categorizing this issue as a bug report.
I lean toward adding this new check in Drupal\phone_number\PhoneNumberUtil::testPhoneNumber() because that is a centralized checker used by both Drupal\phone_number\Plugin\Validation\Constraint\PhoneNumberValidator::validate() (line 69,
$phone_number = $item->getPhoneNumber(TRUE);
) and Drupal\phone_number\Element\PhoneNumber::phoneNumberValidate() (line 244).That would ensure this new check is called in (I think) all situations (render element usage, regular field usage, programmatic entity field usage, etc.) and probably avoid any duplicated error messages.
And to ensure this bug stays fixed, I think we should add a test confirming the fix. It could be as simple as submitting India + 999 into a phone number field, confirming that the submission is not accepted, and confirming the expected form validation error is displayed.