Skip to content
Snippets Groups Projects
Commit 16842fc2 authored by Alex Pott's avatar Alex Pott
Browse files

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

parent 163b5102
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
......@@ -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);
}
}
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