- Issue created by @mr.pomelov
I have been updating the site using Composer while using Drupal version 9, so Composer has updated the module to version 3.3. from version 3.2. Version 3.3. is the latest version in the branch that supports Drupal 9. After the update, the site stopped working with the error "The website encountered an unexpected error. Please try again later."
I see the following error in the PHP console: ArgumentCountError: Too few arguments to function Drupal\\fast404\\Fast404Factory::__construct(), 2 passed in /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 3 expected in /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/modules/contrib/fast_404/src/Fast404Factory.php on line 48 #0 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\\fast404\\Fast404Factory->__construct(Object(Drupal\\Core\\Http\\RequestStack), Object(Drupal\\Core\\Config\\ConfigFactory))\n#1 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\\Component\\DependencyInjection\\Container->createService(Array, 'fast404.factory')\n#2 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\\Component\\DependencyInjection\\Container->get('fast404.factory', 1)\n#3 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\\Component\\DependencyInjection\\Container->resolveServicesAndParameters(Array)\n#4 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\\Component\\DependencyInjection\\Container->createService(Array, 'fast404.')\n#5 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(136): Drupal\\Component\\DependencyInjection\\Container->get('fast404.')\n#6 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/vendor/symfony/http-kernel/HttpKernel.php(145): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch(Object(Symfony\\Component\\HttpKernel\\Event\\RequestEvent), 'kernel.request')\n#7 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#8 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#9 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#10 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#11 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#12 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#13 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#14 /var/www/chel-dpsh.ru/data/www/chel-dpsh.ru/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#15 {main}"
Updating the module on Drupal 9 via Composer to version 3.3
Needs work
3.3
Code