Adding default value validation on NumberWidget
1 unresolved thread
1 unresolved thread
Closes #2907520
Merge request reports
Activity
Filter activity
added 1 commit
- 73952b22 - Adding default value validation on NumberWidget
added 1 commit
- 6cf02f70 - Adding default value validation on NumberWidget
added 1 commit
- bba47903 - Adding default value validation on NumberWidget
added 1 commit
- 0b1b3daa - Updating unit test to validate the scenario that needs to be validate
added 1 commit
- d2443888 - Adding validation for min and max value for numeric field settings
added 1 commit
- 73a5e194 - Adding validation for min and max value for numeric field settings
added 202 commits
-
73a5e194...529c7932 - 195 commits from branch
project:11.x
- 3e2ee67c - Adding default value validation on NumberWidget
- 03bc380d - Adding default value validation on NumberWidget
- fbab99b2 - Adding default value validation on NumberWidget
- ea5c62f0 - Adding default value validation on NumberWidget
- e1fc3cda - Updating unit test to validate the scenario that needs to be validate
- bb5f921d - Adding validation for min and max value for numeric field settings
- ec0bbc33 - Adding validation for min and max value for numeric field settings
Toggle commit list-
73a5e194...529c7932 - 195 commits from branch
75 76 '#placeholder' => $this->getSetting('placeholder'), 76 77 ]; 77 78 79 $buildInfo = $form_state->getBuildInfo(); 80 if (!empty($buildInfo["form_id"]) && $buildInfo["form_id"] === 'field_config_form') { 81 $element['#element_validate'] = [[static::class, 'validateDefaultValue']]; I'm not sure we should be solving this with an additional element validate. This should be already handled by the constraints set by
\Drupal\Core\Field\Plugin\Field\FieldType\NumericItemBase::getConstraints
, so isn't there something wrong if the constraints aren't applied against the default value?
Please register or sign in to reply