Commit 16842fc2 authored by alexpott's avatar alexpott

Issue #2829346 by ekes, kentr, klausi: Allow repeated calls to DrupalKernel::setSitePath()

parent 163b5102
......@@ -410,7 +410,7 @@ public static function findSitePath(Request $request, $require_settings = TRUE,
* {@inheritdoc}
*/
public function setSitePath($path) {
if ($this->booted) {
if ($this->booted && $path !== $this->sitePath) {
throw new \LogicException('Site path cannot be changed after calling boot()');
}
$this->sitePath = $path;
......
......@@ -184,6 +184,11 @@ public function testPreventChangeOfSitePath() {
$pass = TRUE;
}
$this->assertTrue($pass, 'Throws LogicException if DrupalKernel::setSitePath() is called after boot');
// Ensure no LogicException if DrupalKernel::setSitePath() is called with
// identical path after boot.
$path = $kernel->getSitePath();
$kernel->setSitePath($path);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment