Replace non-test usages of \Drupal::formBuilder() with IoC injection

Created on 29 March 2020, over 4 years ago
Updated 3 April 2024, 8 months ago

Problem/Motivation

Follow up #2729597: [meta] Replace \Drupal with injected services where appropriate in core

Some classes does not inject form builder service via DI

Proposed resolution

Replace all of them with IoC injection where possible

Specifically UserLoginBlock and ActionListBuilder

Following should stay as is for BC

core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php:25:    $this->formBuilder = \Drupal::formBuilder();
core/modules/views/src/Plugin/views/display/DisplayPluginBase.php:2263:      $form = \Drupal::formBuilder()->getForm($form_object, $view, $output);
core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php:134:    $form = \Drupal::formBuilder()->buildForm('\Drupal\views\Form\ViewsExposedForm', $form_state);

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.3

Component
Base 

Last updated about 5 hours ago

Created by

🇨🇳China jungle Chongqing, China

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024