Fata error with Drupal 11

Created on 7 August 2024, 6 months ago

Problem/Motivation

The following fatal error (WSoD) occurred when visit the settings form (/admin/config/content/same-page-preview)

ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /web/modules/contrib/same_page_preview/src/Form/SettingsForm.php on line 27 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 43 of /web/core/lib/Drupal/Core/Form/ConfigFormBase.php).

Drupal Version:
11.0.0

PHP Version:
8.3.9

Steps to reproduce

  1. Enable this module.
  2. Login as an admin.
  3. Go to the setting form /admin/config/content/same-page-preview

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇦🇺Australia mingsong 🇦🇺

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

Merge Requests

Comments & Activities

  • Issue created by @mingsong
  • Status changed to Needs review 6 months ago
  • 🇮🇳India Shaikh Sadab

    Hi,

    We have fixed the construct error. However, after fixing it, we encountered another issue:

    Error: Type of Drupal\same_page_preview\Form\SettingsForm::$typedConfigManager must be Drupal\Core\Config\TypedConfigManagerInterface (as in class Drupal\Core\Form\ConfigFormBase) in C:\wamp64\www\drupal-alpha\modules\contrib\same_page_preview\src\Form\SettingsForm.php on line 15

    To resolve this error, we needed to use "typedConfigManager" since we are using the "ConfigFormBase". We have fixed the issue. Please review the patch.

    Thank you!

  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    Thanks for your report. Reviewing your patch.

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 137s
    #319865
  • 🇬🇧United Kingdom scott_euser

    Patch didn't work, constructor promotion was in the parent class, so adding the variable was double-declaring it. Also fixed whitespace issues. Converted to MR to make it easier as well.

    1. Before applying the MR /admin/config/content/same-page-preview has a fatal error as described in the issue summary.
    2. After applying the MR /admin/config/content/same-page-preview is now working without fatal error.

    Agreed this is 'Major' as the module is not usable in Drupal 11 without it unless we consider manually setting the config as a valid workaround, but that takes a particular skillset.

    Thanks!

  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    Hiya Scott. This issue has a high priority for me. I'll be getting some time to fix it next week it seems.

  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    @scott_euser would it be alright to bounce this edit back to you. The fix is the same in principal. But I felt it was important to get the order of injected objects to be the same as what I'm seeing in core.

  • 🇬🇧United Kingdom scott_euser

    Thanks! Retested and works well still in D11

  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul
  • Pipeline finished with Skipped
    3 months ago
    #330329
  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇫🇮Finland YevKo Espoo

    This change is not being pulled when the last version of the module is installed.

Production build 0.71.5 2024