Updated: Comment #N

Problem/Motivation

Drupal\edit\EditController is extends ContainerAware and uses the container to instantiate a form class and uses deprecated procedural form functions

Proposed resolution

The form function can take a class name instead of an instance, thus removing the need to be ContainerAware. By injecting the form_builder service, we removed deprecated procedural calls.

Note: this patch was initially based on chnages by tim.plunkett in his patch at #2110501: ControllerBase should implement ContainerInjectionInterface like FormBase, and should be considered partly his work.

Remaining tasks

Get a clean test run/review of the patch

User interface changes

none

API changes

none

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

Status: Active » Needs review
Related issues: +#2166847: Improve doxygen for FormBuilderInterface::getForm()
FileSize
4.25 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I really like that cleanup and it was already part of the ContainerBase patch!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: 2167169-1.patch, failed testing.

pwolanin’s picture

Status: Needs work » Needs review
FileSize
4.4 KB
1.47 KB

oops - forgot to assign the variable in the constructor and similar stupidity.

This fixes those problems and tests pass locally.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
4.53 KB
606 bytes

+1 for RTBC.

Just fixing a typo in this reroll.

Wim Leers’s picture

Title: cleanup Drupal\edit\EditController: remove ContainerAware and inject form_builder » Clean up Drupal\edit\EditController: remove ContainerAware and inject form_builder
pwolanin’s picture

Issue summary: View changes
pwolanin’s picture

Issue summary: View changes
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.