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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
28f177cd
Commit
28f177cd
authored
Apr 8, 2014
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2234771
by tstoeckler: Drupal_get_profile() should not fall back to 'standard'.
parent
242ac392
No related branches found
No related tags found
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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/includes/common.inc
+7
-4
7 additions, 4 deletions
core/includes/common.inc
core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
+10
-0
10 additions, 0 deletions
...st/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
with
17 additions
and
4 deletions
core/includes/common.inc
+
7
−
4
View file @
28f177cd
...
@@ -193,8 +193,10 @@ function drupal_get_region_content($region = NULL, $delimiter = ' ') {
...
@@ -193,8 +193,10 @@ function drupal_get_region_content($region = NULL, $delimiter = ' ') {
* installation state. At all other times, the "install_profile" setting will be
* installation state. At all other times, the "install_profile" setting will be
* available in settings.php.
* available in settings.php.
*
*
* @return $profile
* @return string|null $profile
* The name of the installation profile.
* The name of the installation profile or NULL if no installation profile is
* currently active. This is the case for example during the first steps of
* the installer or during unit tests.
*/
*/
function
drupal_get_profile
()
{
function
drupal_get_profile
()
{
global
$install_state
;
global
$install_state
;
...
@@ -205,11 +207,12 @@ function drupal_get_profile() {
...
@@ -205,11 +207,12 @@ function drupal_get_profile() {
$profile
=
$install_state
[
'parameters'
][
'profile'
];
$profile
=
$install_state
[
'parameters'
][
'profile'
];
}
}
else
{
else
{
$profile
=
''
;
$profile
=
NULL
;
}
}
}
}
else
{
else
{
$profile
=
Settings
::
get
(
'install_profile'
)
?:
'standard'
;
// Fall back to NULL, if there is no 'install_profile' setting.
$profile
=
Settings
::
get
(
'install_profile'
);
}
}
return
$profile
;
return
$profile
;
...
...
This diff is collapsed.
Click to expand it.
core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
+
10
−
0
View file @
28f177cd
...
@@ -266,4 +266,14 @@ function testEnableModulesTheme() {
...
@@ -266,4 +266,14 @@ function testEnableModulesTheme() {
$this
->
assertTrue
(
drupal_render
(
$element
));
$this
->
assertTrue
(
drupal_render
(
$element
));
}
}
/**
* Tests that drupal_get_profile() returns NULL.
*
* As the currently active installation profile is used when installing
* configuration, for example, this is essential to ensure test isolation.
*/
public
function
testDrupalGetProfile
()
{
$this
->
assertNull
(
drupal_get_profile
());
}
}
}
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