Problem/Motivation
When enabling the module in Drupal 11.0.5, I am getting this error when trying to configure it:
[24-Oct-2024 09:27:03 America/Chicago] Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /modules/contrib/search404/src/Form/Search404Settings.php on line 47 and exactly 2 expected" at /core/lib/Drupal/Core/Form/ConfigFormBase.php line 43
The code in the module looks like this:
public function __construct(ConfigFactoryInterface $configFactory, ModuleHandlerInterface $module_handler) {
parent::__construct($configFactory);
$this->moduleHandler = $module_handler;
}
The parent construct looks like this:
public function __construct(
ConfigFactoryInterface $config_factory,
protected TypedConfigManagerInterface $typedConfigManager,
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
sarwan_verma commentedComment #3
sarwan_verma commentedHi,
I have fixed the "Error trying to configure Search404 in Drupal 11.0.5" issue and attached a patch.
Please review and verify it.
Thanks!
Comment #4
camoa commentedWhy not use the Issue fork?
I believe that is a better practice.
Comment #5
robcarrThis seems to be a really common problem with contrib modules applied in a D11 site. Patch works - it's practically the same fix for every other module. Thank you @sarwan_verma for your work
Comment #6
anybodyI can confirm the settings page is entirely broken with Drupal 11!
Comment #7
anybody@Grevil could you review and fix this maybe?
Comment #8
anybodyThe patch in #3 fixes the issue for Drupal 11 - I'm just not sure, how backwards-compatible it is.
Comment #9
grevil commentedYea, pretty simple fix! Seems like we generally had a miscommunication in https://www.drupal.org/project/search404/issues/3434362#comment-15583056.
Comment #11
grevil commentedIt's not. We need to drop D9 compatibility. But I am unsure, why we even kept it in.
Comment #12
anybodyOk, drop it!
Comment #13
anybodyComment #14
anybody