ArgumentCountError when trying to access some of the price alterators

Created on 5 April 2025, 2 days ago

Problem/Motivation

The following error occurs when trying to navigate to the price alterator settings for specialNights, sundayCheckin, saturdayNightOnly

ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/bee_hotel/modules/beehotel_pricealterators/src/Form/SpecialNights.php on line 105 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 44 of core/lib/Drupal/Core/Form/ConfigFormBase.php).

Steps to reproduce

On a Drupal 11 install with BEE Hotel, navigate to one of the price alterator settings pages via "BEE Hotel" and "Price Alterators".

Proposed resolution

It looks like it's caused by a parameter being optional in Drupal 10, but required in Drupal 11:
https://www.drupal.org/node/3404140

At least in the case of SpecialNights, I've found it to be fixable by avoiding calls to the parent constructor and setting $this->configFactory directly.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.24

Component

Code

Created by

🇬🇧United Kingdom mwrbg

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024