- Issue created by @g089h515r806
- Status changed to Needs review
over 1 year ago 8:19am 20 July 2023 - last update
over 1 year ago 194 pass - ๐ฎ๐ณIndia sumit-k
Adding patch for UrlFieldValidationRule test. Changes are
1> Created test.
2> Added dependencies module
protected static $modules = ['node', 'field_validation', 'path_alias', 'user'];
3> Replaced patch validator function inside UrlFieldValidationRule.php.
- $flag = \Drupal::service('path.validator')->isValid($normal_path); + $flag = \Drupal::service('path.validator')->getUrlIfValidWithoutAccessCheck($normal_path);
- ๐จ๐ณChina g089h515r806
Good work.
1,do not change the code of the validator:
- $flag = \Drupal::service('path.validator')->isValid($normal_path); + $flag = \Drupal::service('path.validator')->getUrlIfValidWithoutAccessCheck($normal_path);
If you think this is bug, you can create another issue.
isValid is OK for most of use case. Drupal 7 version field validation use the similar function which perform a access check.
2, maybe you do not need to install user module๏ผ if validate an internal path, we could use "/node" instead of "/user/1",
3, Added dependencies module
protected static $modules = ['node', 'field_validation', 'path_alias', 'user'];
I am not familar with Drupal test. Is it possible override it in UrlFieldValidationRuleTest instead of FieldValidationRuleBase.
path_alias is only used by this test.
- last update
over 1 year ago 195 pass - ๐ฎ๐ณIndia sumit-k
Thanks for the review and suggestion. Sharing new patches with suggested improvements. Considered points 1 , 2 and 3.
-
g089h515r806 โ
committed 697a4532 on 8.x-1.x authored by
sumit-k โ
Issue #3369911 by sumit-k, g089h515r806: write tests for...
-
g089h515r806 โ
committed 697a4532 on 8.x-1.x authored by
sumit-k โ
- Status changed to Fixed
over 1 year ago 8:51am 24 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.