Loading core/lib/Drupal/Core/Routing/Router.php +13 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,19 @@ public function match($pathinfo) { * {@inheritdoc} */ public function matchRequest(Request $request) { try { $collection = $this->getInitialRouteCollection($request); } // PHP 7.4 introduces changes to its serialization format, which mean that // older versions of PHP are unable to unserialize data that is serialized // in PHP 7.4. If the site's version of PHP has been downgraded, then // attempting to unserialize routes from the database will fail, and so the // router needs to be rebuilt on the current PHP version. // See https://www.php.net/manual/en/migration74.incompatible.php. catch (\TypeError $e) { \Drupal::service('router.builder')->rebuild(); $collection = $this->getInitialRouteCollection($request); } if ($collection->count() === 0) { throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $this->currentPath->getPath())); } Loading Loading
core/lib/Drupal/Core/Routing/Router.php +13 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,19 @@ public function match($pathinfo) { * {@inheritdoc} */ public function matchRequest(Request $request) { try { $collection = $this->getInitialRouteCollection($request); } // PHP 7.4 introduces changes to its serialization format, which mean that // older versions of PHP are unable to unserialize data that is serialized // in PHP 7.4. If the site's version of PHP has been downgraded, then // attempting to unserialize routes from the database will fail, and so the // router needs to be rebuilt on the current PHP version. // See https://www.php.net/manual/en/migration74.incompatible.php. catch (\TypeError $e) { \Drupal::service('router.builder')->rebuild(); $collection = $this->getInitialRouteCollection($request); } if ($collection->count() === 0) { throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $this->currentPath->getPath())); } Loading