- Issue created by @GuyPaddock
- First commit to issue fork.
- Assigned to himanshu_jhaloya
- Merge request !6751Issue #3423053: Replaced \Drupal calls with proper IoC in form elements → (Open) created by himanshu_jhaloya
- Issue was unassigned.
- Status changed to Needs review
7 months ago 7:13am 23 February 2024 - Status changed to Needs work
7 months ago 7:47am 23 February 2024 The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- 🇺🇸United States TR Cascadia
Well, from the test results, you can see why the AccessManager isn't currently injected. That is because it is used inside of
public static function processAutocomplete()
. You can't access instance variables using $this inside a static function, because there is no instance of the class.Additionally, there are a lot of WRONG coding standards changes made in the patch. For example:
- * #element_validate callback for #pattern form element property. + * Element_validate callback for #pattern form element property.
This change is wrong because, like the original comment says, the method is the callback used in #element_validate. While it could be worded differently so that #element_validate doesn't appear at the beginning of the comment, changing that to Element_validate destroys the meaning of the comment. The purpose of coding standards changes should be to improve the content, and they should NOT be done just to make a warning go away.
Regardless, coding standards fixes are out-of-scope for this issue and shouldn't be mixed in with unrelated changes.
I think this should be a "Colsed (works as designed)" because the static \Drupal call is the correct way to access a service inside a static function.