diff --git a/core/modules/shortcut/src/Entity/Shortcut.php b/core/modules/shortcut/src/Entity/Shortcut.php index fa1e1e0..9804fa5 100644 --- a/core/modules/shortcut/src/Entity/Shortcut.php +++ b/core/modules/shortcut/src/Entity/Shortcut.php @@ -136,7 +136,12 @@ public static function preCreate(EntityStorageInterface $storage, array &$values public function preSave(EntityStorageInterface $storage) { parent::preSave($storage); - $url = Url::createFromRequest(Request::create("/{$this->path->value}")); + if ($this->path->value == '') { + $url = new Url($this->path->value); + } + else { + $url = Url::createFromRequest(Request::create("/{$this->path->value}")); + } $this->setRouteName($url->getRouteName()); $this->setRouteParams($url->getRouteParameters()); }