Problem/Motivation

$this->setConfigFactory is already done from the parent class. so not requited to set again in the constructor.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vipin.mittal18 created an issue. See original summary.

vipin.mittal18’s picture

Status: Needs work » Needs review
FileSize
1.38 KB

Kindly apply the attached patch. I have also tested the form after verification.

jcnventura’s picture

Title: Configbase class for configuration objects » Use parent constuctor in ConfigForm.php
Priority: Normal » Minor
Status: Needs review » Needs work

Sorry, but your code can't possibly be right. We could indeed skip the create() and constructor methods, if we weren't also injecting the module.handler service. The code as you proposed would never initialize the parent class configFactory attribute, since the parent constructor would never be called.

The code as we have now is correct, but it could indeed be slightly improved if we called the parent constructor instead of duplicating it's functionality in the constructor of the child class.

  • 31006c0 committed on 8.x-1.x
    Issue #3224623 by jcnventura: Use parent constuctor in ConfigForm.php
    
jcnventura’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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