diff --git a/core/modules/language/migrations/d6_language_content_menu_settings.yml b/core/modules/language/migrations/d6_language_content_menu_settings.yml index 40406bf397..909e2859cf 100644 --- a/core/modules/language/migrations/d6_language_content_menu_settings.yml +++ b/core/modules/language/migrations/d6_language_content_menu_settings.yml @@ -11,6 +11,6 @@ process: target_bundle: 'constants/target_type' target_entity_type_id: 'constants/target_type' default_langcode: 'constants/site_default' - language_alterable: language_alterable + language_alterable: status destination: plugin: entity:language_content_settings diff --git a/core/modules/language/src/Plugin/migrate/source/d6/LanguageContentMenuSettings.php b/core/modules/language/src/Plugin/migrate/source/d6/LanguageContentMenuSettings.php index 03025ee539..21559547ff 100644 --- a/core/modules/language/src/Plugin/migrate/source/d6/LanguageContentMenuSettings.php +++ b/core/modules/language/src/Plugin/migrate/source/d6/LanguageContentMenuSettings.php @@ -8,7 +8,7 @@ /** * Drupal multilingual menu settings. * - * The translation of menu links is enabled if the i18n_menu module is + * The translation of menu links is enabled if the i18nmenu module is * enabled on the source site and not by a variable. * * @MigrateSource( @@ -35,6 +35,8 @@ public function query() { public function fields() { $fields = [ 'name' => $this->t('Name'), + 'type' => $this->t('Type'), + 'status' => $this->t('The status of the i18nmenu module'), ]; return $fields; } @@ -42,16 +44,6 @@ public function fields() { /** * {@inheritdoc} */ - public function prepareRow(Row $row) { - $value = empty($row->getSourceProperty('status')) ? FALSE : TRUE; - $row->setSourceProperty('language_alterable', $value); - $row->setSourceProperty('enabled', $value); - return parent::prepareRow($row); - } - - /** - * {@inheritdoc} - */ public function getIds() { $ids['name']['type'] = 'string'; return $ids; diff --git a/core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentMenuSettingsTest.php b/core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentMenuSettingsTest.php index e1d55ea26a..4d0bd57429 100644 --- a/core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentMenuSettingsTest.php +++ b/core/modules/language/tests/src/Kernel/Plugin/migrate/source/d6/LanguageContentMenuSettingsTest.php @@ -54,8 +54,6 @@ public function providerSource() { [ 'name' => 'i18nmenu', 'status' => '1', - 'language_alterable' => TRUE, - 'enabled' => TRUE, ], ]; diff --git a/core/modules/menu_link_content/migrations/d6_menu_links_translation.yml b/core/modules/menu_link_content/migrations/d6_menu_links_translation.yml index 05df6dd3e0..0a8ae114bf 100644 --- a/core/modules/menu_link_content/migrations/d6_menu_links_translation.yml +++ b/core/modules/menu_link_content/migrations/d6_menu_links_translation.yml @@ -8,9 +8,9 @@ process: id: mlid langcode: language skip: - - plugin: skip_on_empty - method: row - source: migrate + plugin: skip_on_empty + method: row + source: migrate title: - plugin: callback diff --git a/core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php b/core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php index 30cda7f067..72b17249a3 100644 --- a/core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php +++ b/core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php @@ -21,10 +21,10 @@ class MenuLinkTranslation extends DrupalSqlBase { */ public function query() { // Ideally, the query would return rows for each language for each menu link - // with the translations for with both the title and description or just the + // with the translations for both the title and description or just the // title translation or just the description translation. That query quickly // became complex and would be difficult to maintain. - // Therefore, build a query based on 18n_strings table where each row has + // Therefore, build a query based on i18nstrings table where each row has // the translation for only one property, either title or description. The // method prepareRow() is then used to obtain the translation for the other // property. @@ -80,8 +80,7 @@ public function prepareRow(Row $row) { // Get the translation for the property not already in the row. $other_property = ($property == 'title') ? 'description' : 'title'; $query = $this->select('i18n_strings', 'i18n') - ->fields('i18n', ['lid']); - $query + ->fields('i18n', ['lid']) ->condition('i18n.property', $other_property) ->condition('i18n.objectid', $mlid); $query->leftJoin('locales_target', 'lt', 'i18n.lid = lt.lid'); diff --git a/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/source/d6/MenuLinkTranslationTest.php b/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/source/d6/MenuLinkTranslationTest.php index 76927f2678..c7c0334a39 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/source/d6/MenuLinkTranslationTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/source/d6/MenuLinkTranslationTest.php @@ -177,7 +177,7 @@ public function providerSource() { 'translation' => 'fr - title translation', 'plid' => 0, 'plural' => 0, - 'u18n_status' => 0, + 'i18n_status' => 0, ], [ 'lid' => 2, @@ -185,7 +185,7 @@ public function providerSource() { 'translation' => 'fr - description translation', 'plid' => 0, 'plural' => 0, - 'u18n_status' => 0, + 'i18n_status' => 0, ], [ 'lid' => 3, @@ -193,7 +193,7 @@ public function providerSource() { 'translation' => 'zu - description translation', 'plid' => 0, 'plural' => 0, - 'u18n_status' => 0, + 'i18n_status' => 0, ], [ 'lid' => 4, @@ -201,7 +201,7 @@ public function providerSource() { 'translation' => 'zu - title translation', 'plid' => 0, 'plural' => 0, - 'u18n_status' => 0, + 'i18n_status' => 0, ], ];