Deprecated function: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated

Created on 9 February 2023, about 2 years ago
Updated 16 June 2023, almost 2 years ago

Problem

When ever I clear cache I get the warning.

array:31 [▼
  "30: preg_match_all()" => array:1 [▼
    "args" => array:3 [▶]
  ]
  "29: Drupal\Core\Utility\Token->scan()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/Utility/Token.php:293"
    "args" => array:1 [▼
      0 => null
    ]
  ]
  "28: Drupal\menu_token\Service\MenuTokenContextManager->prepareContextualLinks()" => array:2 [▶]
  "27: menu_token_menu_links_discovered_alter()" => array:2 [▼
    "file" => "modules/contrib/menu_token/menu_token.module:451"
    "args" => array:3 [▼
      0 => array:1432 [▼
        
      ]
    ]
  ]
  "25: Drupal\Core\Menu\MenuLinkManager->getDefinitions()" => array:1 [▼
    "file" => "core/lib/Drupal/Core/Menu/MenuLinkManager.php:166"
  ]
  "24: Drupal\Core\Menu\MenuLinkManager->rebuild()" => array:1 [▼
    "file" => "core/lib/Drupal/Core/Menu/MenuLinkManager.php:189"
  ]
  "23: Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->menuLinksRebuild()" => array:1 [▼
    "file" => "core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php:82"
  ]
  "22: Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->onRouterRebuild()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php:70"
    "args" => array:3 [▼
      0 => Drupal\Component\EventDispatcher\Event {#18227 …1}
      1 => "routing.route_finished"
      2 => Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher {#6818}
    ]
  ]
  "21: call_user_func()" => array:1 [▼
    "args" => array:4 [▼
      0 => array:2 [ …2]
      1 => Drupal\Component\EventDispatcher\Event {#18227 …1}
      2 => "routing.route_finished"
      3 => Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher {#6818}
    ]
  ]
  "20: Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()" => array:2 [▶]
  "19: Drupal\Core\Routing\RouteBuilder->rebuild()" => array:1 [▼
    "file" => "core/lib/Drupal/Core/Routing/RouteBuilder.php:197"
  ]
  "18: Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()" => array:1 [▼
    "file" => "core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php:83"
  ]
  "17: drupal_flush_all_caches()" => array:1 [▼
    "file" => "core/includes/common.inc:587"
  ]
  "16: Drupal\admin_toolbar_tools\Controller\ToolbarController->flushAll()" => array:1 [▼
    "file" => "modules/contrib/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php:205"
  ]
  "15: call_user_func_array()" => array:1 [▼
    "args" => array:2 [▼
      0 => array:2 [ …2]
      1 => []
    ]
  ]
  "14: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()" => array:1 [▼
    "file" => "core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123"
  ]
  "13: Drupal\Core\Render\Renderer->executeInRenderContext()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/Render/Renderer.php:580"
    "args" => array:2 [▼
      0 => Drupal\Core\Render\RenderContext {#610 …4}
      1 => Closure() {#612 …5}
    ]
  ]
  "12: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:124"
    "args" => array:2 [▼
      0 => array:2 [ …2]
      1 => []
    ]
  ]
  "11: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()" => array:1 [▼
    "file" => "core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97"
  ]
  "10: Symfony\Component\HttpKernel\HttpKernel->handleRaw()" => array:2 [▼
    "file" => "/code/vendor/symfony/http-kernel/HttpKernel.php:169"
    "args" => array:2 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
    ]
  ]
  " 9: Symfony\Component\HttpKernel\HttpKernel->handle()" => array:2 [▼
    "file" => "/code/vendor/symfony/http-kernel/HttpKernel.php:81"
    "args" => array:3 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
      2 => true
    ]
  ]
  " 8: Drupal\Core\StackMiddleware\Session->handle()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/StackMiddleware/Session.php:58"
    "args" => array:3 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
      2 => true
    ]
  ]
  " 7: Drupal\Core\StackMiddleware\KernelPreHandle->handle()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:48"
    "args" => array:3 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
      2 => true
    ]
  ]
  " 6: Drupal\page_cache\StackMiddleware\PageCache->pass()" => array:2 [▼
    "file" => "core/modules/page_cache/src/StackMiddleware/PageCache.php:106"
    "args" => array:3 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
      2 => true
    ]
  ]
  " 5: Drupal\page_cache\StackMiddleware\PageCache->handle()" => array:2 [▼
    "file" => "core/modules/page_cache/src/StackMiddleware/PageCache.php:85"
    "args" => array:3 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
      2 => true
    ]
  ]
  " 4: Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:48"
    "args" => array:3 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
      2 => true
    ]
  ]
  " 3: Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:51"
    "args" => array:3 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
      2 => true
    ]
  ]
  " 2: Stack\StackedHttpKernel->handle()" => array:2 [▼
    "file" => "/code/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23"
    "args" => array:3 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
      1 => 1
      2 => true
    ]
  ]
  " 1: Drupal\Core\DrupalKernel->handle()" => array:2 [▼
    "file" => "core/lib/Drupal/Core/DrupalKernel.php:713"
    "args" => array:1 [▼
      0 => Symfony\Component\HttpFoundation\Request {#4 …24}
    ]
  ]
  " 0: main()" => array:2 [▼
    "file" => "index.php:19"
    "args" => array:1 [▼
      "token" => "be-Zlkse4cLTeYCsUm2Fewc3-h59CWBgPEIcDOfq_qU"
    ]
  ]
]

Tried
I tried the patch : https://www.drupal.org/project/drupal/issues/3296485 🐛 Deprecated function: preg_match(): Passing null to parameter Postponed: needs info mention in ticket: https://www.drupal.org/project/drupal/issues/3296485 🐛 Deprecated function: preg_match(): Passing null to parameter Postponed: needs info

💬 Support request
Status

Closed: outdated

Version

9.5

Component
Token 

Last updated 20 days ago

No maintainer
Created by

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

Comments & Activities

Production build 0.71.5 2024