Missing parent constructor call in RenameAdminPathsSettingsForm

Created on 3 May 2024, 7 months ago
Updated 3 August 2024, 4 months ago

Problem/Motivation

The parent constructor call is missing in RenameAdminPathsSettingsForm.php. This is because the module is using its own Config service. Let's either call the parent constructor or document why we are doing it this way.

📌 Task
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

🇯🇵Japan ptmkenny

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

Comments & Activities

  • Issue created by @ptmkenny
  • 🇮🇳India aman1248

    Hy @ptmkenny ,

    In the RenameAdminPathsSettingsForm class, you're already using the ConfigFormBase class as a parent class. The ConfigFormBase class has its own constructor that you don't need to explicitly call. When you call parent::submitForm($form, $formState);, it already executes the necessary logic from the parent class constructor.

    So, there's no need to explicitly call the parent constructor in your RenameAdminPathsSettingsForm class. Just keep using parent::submitForm($form, $formState); as you're doing.

  • Status changed to Needs review 7 months ago
  • 🇮🇳India aman1248

    Hy @ptmkenny , please check
    thanks

  • 🇯🇵Japan ptmkenny

    @Amandeep123 Do you know if there is any performance difference between calling the parent constructor in the class vs. waiting to have it called when calling parent::submitForm()?

  • Status changed to Active 7 months ago
  • Status changed to Closed: works as designed 4 months ago
  • 🇯🇵Japan ptmkenny

    After looking into this, I think it is fine as is.

Production build 0.71.5 2024