From 9d78e26fb45555bfcde5a2afd02c15fe6e95d820 Mon Sep 17 00:00:00 2001 From: David Grayston Date: Sat, 7 Apr 2018 23:06:21 +0100 Subject: [PATCH] Case 29516; applying patch to 8.x-1.0-alpha13 --- domain/src/Entity/Domain.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/domain/src/Entity/Domain.php b/domain/src/Entity/Domain.php index edab23cd..d56c576a 100644 --- a/domain/src/Entity/Domain.php +++ b/domain/src/Entity/Domain.php @@ -271,14 +271,16 @@ public function saveProperty($name, $value) { * {@inheritdoc} */ public function setPath() { - $this->path = $this->getScheme() . $this->getHostname() . base_path(); + global $base_path; + $this->path = $this->getScheme() . $this->getHostname() . ($base_path ?: '/'); } /** * {@inheritdoc} */ public function setUrl() { - $uri = \Drupal::request()->getRequestUri(); + $request = \Drupal::request(); + $uri = $request ? $request->getRequestUri() : '/'; $this->url = $this->getScheme() . $this->getHostname() . $uri; }