Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
301
Merge Requests
301
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
747be317
Commit
747be317
authored
Apr 28, 2016
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2582475
by alexpott: Installation fails if a valid config sync directory is defined
parent
8772c0f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
3 deletions
+47
-3
core/includes/install.core.inc
core/includes/install.core.inc
+1
-3
core/lib/Drupal/Core/Installer/InstallerKernel.php
core/lib/Drupal/Core/Installer/InstallerKernel.php
+13
-0
core/modules/system/src/Tests/Installer/InstallerExistingConfigDirectoryTest.php
.../Tests/Installer/InstallerExistingConfigDirectoryTest.php
+33
-0
No files found.
core/includes/install.core.inc
View file @
747be317
...
...
@@ -7,7 +7,6 @@
use
Drupal\Component\Utility\UrlHelper
;
use
Drupal\Core\DrupalKernel
;
use
Drupal\Core\Config\BootstrapConfigStorageFactory
;
use
Drupal\Core\Database\Database
;
use
Drupal\Core\Database\DatabaseExceptionWrapper
;
use
Drupal\Core\Form\FormState
;
...
...
@@ -489,8 +488,7 @@ function install_begin_request($class_loader, &$install_state) {
// Ensure that the active configuration is empty before installation starts.
if
(
$install_state
[
'config_verified'
]
&&
empty
(
$task
))
{
$config
=
BootstrapConfigStorageFactory
::
get
()
->
listAll
();
if
(
!
empty
(
$config
))
{
if
(
count
(
$kernel
->
getConfigStorage
()
->
listAll
()))
{
$task
=
NULL
;
throw
new
AlreadyInstalledException
(
$container
->
get
(
'string_translation'
));
}
...
...
core/lib/Drupal/Core/Installer/InstallerKernel.php
View file @
747be317
...
...
@@ -33,4 +33,17 @@ public function resetConfigStorage() {
$this
->
configStorage
=
NULL
;
}
/**
* Returns the active configuration storage used during early install.
*
* This override changes the visibility so that the installer can access
* config storage before the container is properly built.
*
* @return \Drupal\Core\Config\StorageInterface
* The config storage.
*/
public
function
getConfigStorage
()
{
return
parent
::
getConfigStorage
();
}
}
core/modules/system/src/Tests/Installer/InstallerExistingConfigDirectoryTest.php
0 → 100644
View file @
747be317
<?php
namespace
Drupal\system\Tests\Installer
;
use
Drupal\simpletest\InstallerTestBase
;
/**
* Tests the installer when a config_directory has already been set up.
*
* @group Installer
*/
class
InstallerExistingConfigDirectoryTest
extends
InstallerTestBase
{
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
$this
->
settings
[
'config_directories'
][
CONFIG_SYNC_DIRECTORY
]
=
(
object
)
array
(
'value'
=>
$this
->
siteDirectory
.
'/config'
,
'required'
=>
TRUE
,
);
parent
::
setUp
();
}
/**
* Verifies that installation succeeded.
*/
public
function
testInstaller
()
{
$this
->
assertUrl
(
'user/1'
);
$this
->
assertResponse
(
200
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment