Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
16842fc2
Commit
16842fc2
authored
8 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2829346
by ekes, kentr, klausi: Allow repeated calls to DrupalKernel::setSitePath()
parent
163b5102
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/lib/Drupal/Core/DrupalKernel.php
+1
-1
1 addition, 1 deletion
core/lib/Drupal/Core/DrupalKernel.php
core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php
+5
-0
5 additions, 0 deletions
...Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php
with
6 additions
and
1 deletion
core/lib/Drupal/Core/DrupalKernel.php
+
1
−
1
View file @
16842fc2
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php
+
5
−
0
View file @
16842fc2
...
...
@@ -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
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment