- Issue created by @sgalindo2388
- πΊπΈUnited States TolstoyDotCom L.A.
The error is coming from the FieldValidationRuleAddForm class, it extends FieldValidationRuleFormBase but it doesn't call the base class' constructor. As a result, the injected services in the base class aren't being set up.
One solution is to create the child classes with a superset of all the services, then have each child class call the parent class constructor with the arguments it expects.
Patch on request.
- π¨π³China g089h515r806
1, This issue related π \Drupal calls should be avoided in classes, use dependency injection instead Fixed , the patch looks good, and I commit it directly 2 days ago.
2, TolstoyDotCom is right, I will fixed it later.
3, another solution, you can change the code back:from
if ($this->moduleHandler->moduleExists('token')) {
to
// Add a token link. if (\Drupal::moduleHandler()->moduleExists('token')) {
-
g089h515r806 β
committed f98761c3 on 8.x-1.x
Issue #3377168 by sgalindo2388, TolstoyDotCom, g089h515r806: Error: Call...
-
g089h515r806 β
committed f98761c3 on 8.x-1.x
- Status changed to Fixed
over 1 year ago 1:14am 27 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.