TypeError: Symfony\Component\HttpFoundation\InputBag::get(): Argument #1 ($key) must be of type string, null given, called in /var/www/html/docroot/core/lib/Drupal/Core/Routing/RouteMatch.php on line 127 in Symfony\Component\HttpFoundation\InputBag->get()

Created on 2 November 2023, about 1 year ago
Updated 31 January 2024, 11 months ago
🐛 Bug report
Status

Postponed: needs info

Version

10.1

Component
Field 

Last updated 1 day ago

Created by

🇨🇳China jessey

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

Comments & Activities

  • Issue created by @jessey
  • 🇬🇧United Kingdom longwave UK

    What did you do to trigger this error message? This feels like an incomplete routing definition somewhere.

  • Status changed to Postponed: needs info about 1 year ago
  • 🇦🇺Australia gigimaor Narangba/Brisbane

    In my case, after updating the core version to 10.2.2
    In /admin/config/people/accounts

    TypeError: Symfony\Component\HttpFoundation\InputBag::get(): Argument #1 ($key) must be of type string, null given, called in /code/web/core/lib/Drupal/Core/Routing/RouteMatch.php on line 127 in Symfony\Component\HttpFoundation\InputBag->get() (line 29 of /code/vendor/symfony/http-foundation/InputBag.php).
    Drupal\Core\Routing\RouteMatch->getRawParameter() (Line: 61)
    Drupal\workflow_field_groups\Access\WorkflowFieldGroupsAccessCheck->access()
    call_user_func_array() (Line: 160)
    Drupal\Core\Access\AccessManager->performCheck() (Line: 136)
    Drupal\Core\Access\AccessManager->check() (Line: 93)
    ...
    

    In my case, it is caused by a module that is not supported anymore but is still in use: workflow_field_groups

    On this line web/core/lib/Drupal/Core/Routing/RouteMatch.php on line 127 $parameter_name is NULL

      public function getParameter($parameter_name) {
        return $this->parameters->get($parameter_name);
      }
    

    Preventing this from happening could be done by patching this line
    return $this->parameters->get($parameter_name);
    to this
    return $this->parameters->get($parameter_name ?? '');

  • 🇬🇧United Kingdom longwave UK

    The fix should be made in workflow_field_groups, why is it calling getParameter(NULL)?

Production build 0.71.5 2024