Commit 498063a9 authored by bircher's avatar bircher

Issue #3099674 fix to use latest patch

parent b52fde4a
......@@ -24,9 +24,10 @@
"license": "GPL-2.0+",
"minimum-stability": "dev",
"require": {
"drupal/core": "^8.8"
"php": ">=7.1.3",
"drupal/core": "^8.8 || ^9"
},
"require-dev": {
"drush/drush": "~10"
"drush/drush": "^10"
}
}
......@@ -9,7 +9,7 @@ build:
testing:
container_command:
commands:
- "cd ${SOURCE_DIR} && sudo -u www-data composer require drush/drush:~10"
- "cd ${SOURCE_DIR} && sudo -u www-data composer require drush/drush:^10"
run_tests.standard:
types: 'Simpletest,PHPUnit-Unit,PHPUnit-Kernel,PHPUnit-Functional'
run_tests.js:
......
......@@ -67,10 +67,6 @@ class ConfigIgnoreEventSubscriber implements EventSubscriberInterface {
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
if (Settings::get('config_ignore_deactivate')) {
return [];
}
return [
ConfigEvents::STORAGE_TRANSFORM_IMPORT => ['onImportTransform'],
ConfigEvents::STORAGE_TRANSFORM_EXPORT => ['onExportTransform'],
......@@ -84,7 +80,9 @@ class ConfigIgnoreEventSubscriber implements EventSubscriberInterface {
* The config storage transform event.
*/
public function onImportTransform(StorageTransformEvent $event) {
$this->transformStorage($event->getStorage(), $this->activeStorage);
if (!Settings::get('config_ignore_deactivate')) {
$this->transformStorage($event->getStorage(), $this->activeStorage);
}
}
/**
......@@ -94,7 +92,9 @@ class ConfigIgnoreEventSubscriber implements EventSubscriberInterface {
* The config storage transform event.
*/
public function onExportTransform(StorageTransformEvent $event) {
$this->transformStorage($event->getStorage(), $this->syncStorage);
if (!Settings::get('config_ignore_deactivate')) {
$this->transformStorage($event->getStorage(), $this->syncStorage);
}
}
/**
......
......@@ -10,7 +10,8 @@ use Drush\TestTraits\DrushTestTrait;
/**
* Tests config_ignore with translated configurations.
*
* This test is using Drush to perform the export/import operations.
* This test is using Drush to perform the export/import operations in order to
* test with a real config import/export tool.
*
* @group config_ignore
*/
......@@ -65,11 +66,11 @@ class ConfigWithTranslationTest extends BrowserTestBase {
// Change also the translation of user.role.anonymous.
$this->translateConfig('user.role.anonymous', 'label', 'Vizitator', 'ro');
// Export changes.
// Get config status.
$this->drush('config:status', [], ['format' => 'json']);
$diff = (array) $this->getOutputFromJSON();
// Check that only config_ignore.settings & user.settings are shown.
// Check that only config_ignore.settings and user.settings are shown.
$this->assertCount(2, $diff);
$this->assertArrayHasKey('config_ignore.settings', $diff);
$this->assertSame(['name' => 'config_ignore.settings', 'state' => 'Different'], $diff['config_ignore.settings']);
......@@ -94,7 +95,7 @@ class ConfigWithTranslationTest extends BrowserTestBase {
$this->assertExportedValue('user.settings', 'anonymous', 'Visitor');
// Check that the main user.role.anonymous.yml file was not overridden.
$this->assertExportedValue('user.role.anonymous', 'label', 'Anonymous user');
// Check that the translated override has been created.
// Check that the translated version was not overridden.
$this->assertExportedValue('user.role.anonymous', 'label', 'Utilizator anonim', 'ro');
}
......@@ -122,7 +123,7 @@ class ConfigWithTranslationTest extends BrowserTestBase {
$this->assertSame('Visitor', $this->config('user.settings')->get('anonymous'));
// Check that user.role.anonymous has been preserved.
$this->assertSame('Anonymous user', $this->config('user.role.anonymous')->get('label'));
// Check that also the user.role.anonymous translation has been preserved.
// Check that the user.role.anonymous translation has been also preserved.
$language_manager = \Drupal::languageManager();
$original_language = $language_manager->getConfigOverrideLanguage();
/** @var \Drupal\language\Config\LanguageConfigOverride $translated */
......@@ -165,7 +166,7 @@ class ConfigWithTranslationTest extends BrowserTestBase {
* @param string $config_name
* The config name.
* @param string $key
* The config key to be translated. It only supports top level keys.
* The config key to be translated. It only supports top level keys.
* @param string $value
* The translated value.
* @param string $langcode
......
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