Skip to content
Snippets Groups Projects
Commit ed9c2a50 authored by Larry Garfield's avatar Larry Garfield
Browse files

Make NullGenerator fail gracefully, since we can't yet avoid it being called at all.

parent 99e068c4
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -8,6 +8,7 @@
namespace Drupal\Core\Routing;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
/**
* No-op implementation of a Url Generator, needed for backward compatibility.
......@@ -15,14 +16,13 @@
class NullGenerator implements UrlGeneratorInterface {
public function generate($name, $parameters = array(), $absolute = FALSE) {
throw new \Exception('Method disabled. This is a dummy implementation.');
return '';
throw new RouteNotFoundException();
}
public function setContext(RequestContext $context) {
throw new \Exception('Method disabled. This is a dummy implementation.');
}
public function getContext() {
throw new \Exception('Method disabled. This is a dummy implementation.');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment