From 5da22c7a8cb7b1f85988fa8ac849d7825fa63810 Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 31 Aug 2015 09:48:58 -0700 Subject: [PATCH] =?UTF-8?q?Issue=20#2130307=20by=20quietone,=20michaellena?= =?UTF-8?q?han,=20phenaproxima,=20David=20Hern=C3=A1ndez,=20fastangel,=20e?= =?UTF-8?q?liza411:=20Variable=20to=20config:=20language.negotiation=20[d7?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../d7_language_negotiation_settings.yml | 15 +++++++ ...MigrateLanguageNegotiationSettingsTest.php | 43 +++++++++++++++++++ .../src/Tests/Table/d7/Variable.php | 8 +++- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 core/modules/language/migration_templates/d7_language_negotiation_settings.yml create mode 100644 core/modules/language/src/Tests/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php diff --git a/core/modules/language/migration_templates/d7_language_negotiation_settings.yml b/core/modules/language/migration_templates/d7_language_negotiation_settings.yml new file mode 100644 index 00000000000..aace5fd51c4 --- /dev/null +++ b/core/modules/language/migration_templates/d7_language_negotiation_settings.yml @@ -0,0 +1,15 @@ +id: d7_language_negotiation_settings +label: Drupal 7 language negotiation settings +migration_tags: + - Drupal 7 +source: + plugin: variable + variables: + - locale_language_negotiation_session_param + - locale_language_negotiation_url_part +process: + 'session/parameter': locale_language_negotiation_session_param + 'url/source': locale_language_negotiation_url_part +destination: + plugin: config + config_name: language.negotiation diff --git a/core/modules/language/src/Tests/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php b/core/modules/language/src/Tests/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php new file mode 100644 index 00000000000..242d818b4e5 --- /dev/null +++ b/core/modules/language/src/Tests/Migrate/d7/MigrateLanguageNegotiationSettingsTest.php @@ -0,0 +1,43 @@ +executeMigration('d7_language_negotiation_settings'); + } + + /** + * Tests migration of language negotiation variables to language.negotiation.yml. + */ + public function testLanguageNegotiation() { + $config = $this->config('language.negotiation'); + $this->assertIdentical($config->get('session.parameter'), 'language'); + $this->assertIdentical($config->get('url.source'), 'domain'); + } + +} diff --git a/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php b/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php index 18351afd8ea..177ec928424 100644 --- a/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php +++ b/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php @@ -199,6 +199,12 @@ class Variable extends DrupalDumpBase { ))->values(array( 'name' => 'language_types', 'value' => 'a:3:{s:8:"language";b:1;s:16:"language_content";b:0;s:12:"language_url";b:0;}', + ))->values(array( + 'name' => 'locale_language_negotiation_session_param', + 'value' => 's:8:"language";', + ))->values(array( + 'name' => 'locale_language_negotiation_url_part', + 'value' => 's:6:"domain";', ))->values(array( 'name' => 'maintenance_mode', 'value' => 'i:0;', @@ -482,4 +488,4 @@ class Variable extends DrupalDumpBase { } } -#e9148e9bed6f5b345cc1a281afe38dd0 +#6c379107303f95fe9118597506168dc2