- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
public static function validateMinMax
1. can this be typehinted please'#description' => $this->t('The maximum value that should be allowed in this field. Leave blank for no maximum.'), + ];
2. seems unintended
Did not test yet.
- Status changed to Needs review
almost 2 years ago 7:43pm 8 February 2023 - 🇮🇳India kkalashnikov Ghaziabad, India
Patch #23 is applied and working fine for Drupal version 10.1.x. It can move for RTBC.
- Status changed to RTBC
almost 2 years ago 4:45pm 9 February 2023 - 🇺🇸United States smustgrave
Thank you @kkalashnikov but a screenshot of the patch does not provide value, we know that by the CI build. See https://www.drupal.org/about/core/policies/maintainers/how-is-credit-gra... → . Removing credit for that.
Reviewing #23
Confirmed the fields mentioned in the IS does save invalid option (min: 4; max: -4)
Applied patch
Tested all the scenarios in the IS (integer, float, decimal) and I get a warning when trying to save those values.Good work!
- Status changed to Needs work
almost 2 years ago 3:23am 10 February 2023 - 🇳🇿New Zealand quietone
I took a look at the patch.
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php @@ -197,7 +197,7 @@ public function testNumberIntegerField() { + // Submit a valid integer. @@ -207,7 +207,7 @@ public function testNumberIntegerField() { + // Try to set a value below the minimum value. @@ -215,7 +215,7 @@ public function testNumberIntegerField() { + // Try to set a decimal value. @@ -223,7 +223,7 @@ public function testNumberIntegerField() { + // Try to set a value above the maximum value.
These changes are out of scope
-
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php @@ -428,6 +428,64 @@ public function testCreateNumberDecimalField() { + public function testCreateDecimalMaxLessThanMinValidation() {
These and the following should be incorporated into an existing test. There is no need to add additional setup costs for a functional test here.
-
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php @@ -428,6 +428,64 @@ public function testCreateNumberDecimalField() { + $this->helperValidateFieldConfig('integer', $edit); ... + $this->helperValidateFieldConfig('integer', $edit);
Can we use the same field and not re-create one?
-
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php @@ -451,4 +509,31 @@ public function assertSetMinimumValue(FieldConfigInterface $field, $minimum_valu + * Helper function to test form config submit.
This should tell me what it does. See Coding standards for summary lines → for more details.
-
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php @@ -451,4 +509,31 @@ public function assertSetMinimumValue(FieldConfigInterface $field, $minimum_valu + public function helperValidateFieldConfig($type, $edit) {
The title should reflect what the function is doing. It isn't doing validation.
-
- @joaopaulocdev opened merge request.
- Assigned to joaopauloc.dev
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 2:43pm 11 February 2023 - 🇮🇳India DeepaliJ
Able to reproduce the issue using IS
Verified and tested MR #27 on Drupal 10.1.x-dev
The patch applied cleanly
The issue gets resolved after applying the patch.
Refer to the attached after patch screenshot - Status changed to RTBC
almost 2 years ago 10:39pm 11 February 2023 - 🇺🇸United States smustgrave
Moving back to RTBC. The changes in #26 appear to be addressed
26.1 = was removed
26.2 = helper function was removed and test simplified
26.3 = the test is existing so not sure we should update here
26.4 = help function was removed - Status changed to Needs work
almost 2 years ago 7:36am 20 February 2023 - last update
over 1 year ago Custom Commands Failed - @joaopaulocdev opened merge request.
- last update
over 1 year ago 30,136 pass, 2 fail - last update
over 1 year ago 30,144 pass - Status changed to Needs review
over 1 year ago 7:25pm 5 September 2023 - 🇧🇷Brazil joaopauloc.dev
Hello @quietone, I'm not sure if I understood or fixed the issues about moving the unit test to a kernel class.
Also, I didn't find any other way to test validateMinAndMaxConfig so I tested the method statically.
Maybe, we can also add the test back that I implemented in the other mr
Waiting for some feedback to update the code if necessary. - Status changed to Needs work
over 1 year ago 5:06pm 8 September 2023 - 🇺🇸United States smustgrave
Left a small comment on MR 4709 about adding an additional test set.
The kernel test looks good but don't see any reason to not include the additional asserts from MR 3436. If it were it's own function/bootstrap then maybe but that's expanding an existing tests. @quietone thoughts?
- last update
over 1 year ago 30,159 pass - Status changed to Needs review
over 1 year ago 1:53pm 13 September 2023 - 🇧🇷Brazil joaopauloc.dev
I added the test min 1 max 0.
Also, the Functional test with a tiny improvement where I added an assert to check the numbers as string values for the Integer type field. Now, as we have the kernel test I don't think we need to test for every number type. Just for integer is enough, but if you guys think is necessary I can add for each number field type. - Status changed to RTBC
over 1 year ago 1:58pm 13 September 2023 - 🇺🇸United States smustgrave
Sweet! Seems to address the failure from the previous MR.
- Status changed to Needs work
over 1 year ago 5:43pm 14 September 2023 - 🇺🇸United States xjm
Hiding patches; I just wasted 20 minutes reviewing an old thing. :P
- 🇺🇸United States xjm
NW for many things as per my MR comments. Thanks everyone!
- 🇧🇷Brazil joaopauloc.dev
This issue Field UI doesn't validate a field's default value on create 🐛 Field UI doesn't validate a field's default value on create Active is very similar, should I fix this issue here added as related issue or it's better to fix in another branch?
Working on code review comments - last update
over 1 year ago 30,130 pass, 3 fail - last update
over 1 year ago 30,135 pass, 1 fail - last update
over 1 year ago 30,163 pass - Status changed to Needs review
over 1 year ago 9:18pm 14 September 2023 - Status changed to Needs work
over 1 year ago 2:03pm 15 September 2023 6:25 20:42 Running- Status changed to Needs review
over 1 year ago 4:14pm 15 September 2023 - Status changed to RTBC
over 1 year ago 4:44pm 15 September 2023 - Status changed to Needs work
over 1 year ago 7:54pm 16 September 2023 - 🇺🇸United States xjm
Thanks @joaopauloc.dev and @smustgrave!
We should avoid
mixed
if at all possible. PHP 8 supports union types so we can sayint|string
based on the current test. (This fix includes an API addition and is therefore notbackportable, so we don't need to worry about legacy PHP 7 compatibility for D9.)Interesting aside that does not actually affect the MR here: Note the behavior of int typehints with integer strings:
https://3v4l.org/LnQvWRegarding #41, I added that to the related issues for now.
- last update
over 1 year ago 30,170 pass - Status changed to Needs review
over 1 year ago 2:41am 18 September 2023 - Status changed to RTBC
over 1 year ago 2:12pm 18 September 2023 - 🇺🇸United States smustgrave
That was my mistake for suggesting it. Didn't know we wanted to avoid mixed but now I do!
- last update
about 1 year ago 30,177 pass 30:25 27:19 Running- last update
about 1 year ago 30,214 pass - last update
about 1 year ago 30,372 pass - last update
about 1 year ago 30,371 pass - last update
about 1 year ago 30,369 pass - last update
about 1 year ago 30,369 pass - last update
about 1 year ago 30,380 pass - last update
about 1 year ago 30,385 pass, 2 fail - last update
about 1 year ago 30,391 pass - last update
about 1 year ago 30,401 pass - Status changed to Needs work
about 1 year ago 8:56am 12 October 2023 - 🇳🇿New Zealand quietone
Found a few things, commented in the MR. Of most concern is the behavior change which now prevents setting the min = max.
- last update
about 1 year ago 30,422 pass - Status changed to Needs review
about 1 year ago 3:36pm 17 October 2023 - Status changed to RTBC
about 1 year ago 2:59pm 18 October 2023 45:55 4:25 Running- last update
about 1 year ago 30,434 pass - last update
about 1 year ago 30,435 pass - last update
about 1 year ago 30,445 pass - last update
about 1 year ago 30,450 pass - First commit to issue fork.
- Status changed to Fixed
about 1 year ago 2:03pm 28 October 2023 Automatically closed - issue fixed for 2 weeks with no activity.