Skip to content
Snippets Groups Projects
Commit 960fd172 authored by IMMACULATE X's avatar IMMACULATE X Committed by Sascha Grossenbacher
Browse files

Issue #3452928 by immaculatexavier, berdir, primsi: Imports fail when langcode contains a hyphen

parent d36dfcae
No related branches found
No related tags found
1 merge request!2Update file content_workflow_bynder.module
Pipeline #319653 passed with warnings
Showing
with 58 additions and 8 deletions
......@@ -69,7 +69,6 @@ function content_workflow_bynder_import_process($cwb_ids, array $import_options,
->createInstance($migrationId);
if ($migration) {
// Do not use the item list feature of the parent migration class,
// limit the source directly as this is more efficient and sources
// may be multiplied to support repeatable components.
......
......@@ -5,7 +5,7 @@ id: '429623'
project_id: 86701
project: 'Test project'
template_id: 429623
template: 'Meta tag multilang'
name: 'Meta tag multilang'
entity_type: node
content_type: test_content
content_type_name: 'Test content'
......
......@@ -5,7 +5,7 @@ id: '791717'
project_id: 86701
project: 'Test project'
template_id: 791717
template: Article
name: Article
entity_type: node
content_type: page
content_type_name: 'Basic page'
......
......@@ -5,7 +5,7 @@ id: '821317'
project_id: 86701
project: 'Test project'
template_id: 821317
template: 'Simple multilang'
name: 'Simple multilang'
entity_type: node
content_type: test_content
content_type_name: 'Test content'
......
......@@ -5,7 +5,7 @@ id: '823399'
project_id: 86701
project: 'Test project'
template_id: 823399
template: 'Meta tag'
name: 'Meta tag'
entity_type: node
content_type: test_content_meta
content_type_name: 'Test content meta'
......
......@@ -374,8 +374,12 @@ class MigrationDefinitionCreator {
$definition = self::BASIC_SCHEMA_CWB_DESTINATION_CONFIG;
$definition['langcode'] = $language;
$definition['id'] = implode('_', $baseData) . "_$language";
$definition['label'] = implode('_', $baseDataLabel) . "_$language";
// Strip out '-' from language-country part of id.
$label_langcode = str_replace('-', '', $language);
$definition['id'] = implode('_', $baseData) . "_$label_langcode";
$definition['label'] = implode('_', $baseDataLabel) . "_$label_langcode";
$definition['source']['projectId'] = $this->mapping->getGathercontentProjectId();
$definition['source']['templateId'] = $this->mapping->getGathercontentTemplateId();
......
......@@ -11,8 +11,9 @@ entity_type: node
content_type: article
content_type_name: Article
updated_drupal: '1539089126'
data: 'a:2:{s:16:"tab1502959217871";a:4:{s:4:"type";s:7:"content";s:8:"language";s:2:"en";s:8:"elements";a:9:{s:15:"el1502959595615";s:5:"title";s:15:"el1502959226216";s:17:"node.article.body";s:15:"el1503046930689";s:0:"";s:15:"el1503046753703";s:0:"";s:15:"el1503046763382";s:0:"";s:15:"el1503046796344";s:0:"";s:15:"el1503046889180";s:0:"";s:15:"el1503046917174";s:0:"";s:15:"el1503050151209";s:0:"";}s:20:"element_text_formats";a:4:{s:15:"el1502959226216";s:15:"restricted_html";s:15:"el1503046796344";s:0:"";s:15:"el1503046917174";s:0:"";s:15:"el1503050151209";s:0:"";}}s:16:"tab1503046938794";a:4:{s:4:"type";s:7:"content";s:8:"language";s:2:"hu";s:8:"elements";a:9:{s:15:"el1503046938794";s:5:"title";s:15:"el1503046938795";s:17:"node.article.body";s:15:"el1503046938796";s:0:"";s:15:"el1503046938797";s:0:"";s:15:"el1503046938798";s:0:"";s:15:"el1503046938799";s:0:"";s:15:"el1503046938800";s:0:"";s:15:"el1503046938801";s:0:"";s:15:"el1503050171534";s:0:"";}s:20:"element_text_formats";a:4:{s:15:"el1503046938795";s:10:"plain_text";s:15:"el1503046938799";s:0:"";s:15:"el1503046938801";s:0:"";s:15:"el1503050171534";s:0:"";}}}'
data: 'a:3:{s:16:"tab1502959217871";a:4:{s:4:"type";s:7:"content";s:8:"language";s:2:"en";s:8:"elements";a:9:{s:15:"el1502959595615";s:5:"title";s:15:"el1502959226216";s:17:"node.article.body";s:15:"el1503046930689";s:0:"";s:15:"el1503046753703";s:0:"";s:15:"el1503046763382";s:0:"";s:15:"el1503046796344";s:0:"";s:15:"el1503046889180";s:0:"";s:15:"el1503046917174";s:0:"";s:15:"el1503050151209";s:0:"";}s:20:"element_text_formats";a:4:{s:15:"el1502959226216";s:15:"restricted_html";s:15:"el1503046796344";s:0:"";s:15:"el1503046917174";s:0:"";s:15:"el1503050151209";s:0:"";}}s:16:"tab1503046938794";a:4:{s:4:"type";s:7:"content";s:8:"language";s:2:"hu";s:8:"elements";a:9:{s:15:"el1503046938794";s:5:"title";s:15:"el1503046938795";s:17:"node.article.body";s:15:"el1503046938796";s:0:"";s:15:"el1503046938797";s:0:"";s:15:"el1503046938798";s:0:"";s:15:"el1503046938799";s:0:"";s:15:"el1503046938800";s:0:"";s:15:"el1503046938801";s:0:"";s:15:"el1503050171534";s:0:"";}s:20:"element_text_formats";a:4:{s:15:"el1503046938795";s:10:"plain_text";s:15:"el1503046938799";s:0:"";s:15:"el1503046938801";s:0:"";s:15:"el1503050171534";s:0:"";}}s:16:"tab1503046938795";a:4:{s:4:"type";s:7:"content";s:8:"language";s:5:"en-gb";s:8:"elements";a:9:{s:15:"el1503046938794";s:5:"title";s:15:"el1503046938795";s:17:"node.article.body";s:15:"el1503046938796";s:0:"";s:15:"el1503046938797";s:0:"";s:15:"el1503046938798";s:0:"";s:15:"el1503046938799";s:0:"";s:15:"el1503046938800";s:0:"";s:15:"el1503046938801";s:0:"";s:15:"el1503050171534";s:0:"";}s:20:"element_text_formats";a:4:{s:15:"el1503046938795";s:10:"plain_text";s:15:"el1503046938799";s:0:"";s:15:"el1503046938801";s:0:"";s:15:"el1503050171534";s:0:"";}}}'
template: "O:8:\"stdClass\":1:{s:4:\"data\";O:8:\"stdClass\":11:{s:2:\"id\";i:821317;s:10:\"project_id\";i:86701;s:10:\"created_by\";i:187189;s:10:\"updated_by\";i:187189;s:4:\"name\";s:16:\"Simple multilang\";s:11:\"description\";s:17:\"Multilang content\";s:7:\"used_at\";s:19:\"2017-08-18 09:56:15\";s:10:\"created_at\";i:1502959308;s:10:\"updated_at\";i:1503050175;s:5:\"usage\";O:8:\"stdClass\":1:{s:10:\"item_count\";i:1;}s:6:\"config\";a:2:{i:0;O:8:\"stdClass\":4:{s:5:\"label\";s:2:\"EN\";s:4:\"name\";s:16:\"tab1502959217871\";s:6:\"hidden\";b:0;s:8:\"elements\";a:9:{i:0;O:8:\"stdClass\":9:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:15:\"el1502959595615\";s:8:\"required\";b:0;s:5:\"label\";s:5:\"Title\";s:5:\"value\";s:0:\"\";s:9:\"microcopy\";s:0:\"\";s:10:\"limit_type\";s:5:\"words\";s:5:\"limit\";i:0;s:10:\"plain_text\";b:1;}i:1;O:8:\"stdClass\":9:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:15:\"el1502959226216\";s:8:\"required\";b:0;s:5:\"label\";s:4:\"Body\";s:5:\"value\";s:16:\"<p>\n \n</p>\";s:9:\"microcopy\";s:0:\"\";s:10:\"limit_type\";s:5:\"words\";s:5:\"limit\";i:0;s:10:\"plain_text\";b:0;}i:2;O:8:\"stdClass\":5:{s:4:\"type\";s:5:\"files\";s:4:\"name\";s:15:\"el1503046930689\";s:8:\"required\";b:0;s:5:\"label\";s:5:\"Image\";s:9:\"microcopy\";s:0:\"\";}i:3;O:8:\"stdClass\":7:{s:4:\"type\";s:12:\"choice_radio\";s:4:\"name\";s:15:\"el1503046753703\";s:8:\"required\";b:0;s:5:\"label\";s:5:\"Radio\";s:9:\"microcopy\";s:0:\"\";s:12:\"other_option\";b:0;s:7:\"options\";a:3:{i:0;O:8:\"stdClass\":3:{s:4:\"name\";s:15:\"op1503046753704\";s:5:\"label\";s:12:\"First choice\";s:8:\"selected\";b:0;}i:1;O:8:\"stdClass\":3:{s:4:\"name\";s:15:\"op1503046753705\";s:5:\"label\";s:13:\"Second choice\";s:8:\"selected\";b:0;}i:2;O:8:\"stdClass\":3:{s:4:\"name\";s:15:\"op1503046753706\";s:5:\"label\";s:12:\"Third choice\";s:8:\"selected\";b:0;}}}i:4;O:8:\"stdClass\":6:{s:4:\"type\";s:15:\"choice_checkbox\";s:4:\"name\";s:15:\"el1503046763382\";s:8:\"required\";b:0;s:5:\"label\";s:10:\"Checkboxes\";s:9:\"microcopy\";s:0:\"\";s:7:\"options\";a:2:{i:0;O:8:\"stdClass\":3:{s:4:\"name\";s:15:\"op1503046763383\";s:5:\"label\";s:7:\"Choice1\";s:8:\"selected\";b:0;}i:1;O:8:\"stdClass\":3:{s:4:\"name\";s:15:\"op1503046763384\";s:5:\"label\";s:7:\"Choice2\";s:8:\"selected\";b:0;}}}i:5;O:8:\"stdClass\":9:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:15:\"el1503046796344\";s:8:\"required\";b:0;s:5:\"label\";s:9:\"Para text\";s:5:\"value\";s:16:\"<p>\n \n</p>\";s:9:\"microcopy\";s:0:\"\";s:10:\"limit_type\";s:5:\"words\";s:5:\"limit\";i:0;s:10:\"plain_text\";b:0;}i:6;O:8:\"stdClass\":5:{s:4:\"type\";s:5:\"files\";s:4:\"name\";s:15:\"el1503046889180\";s:8:\"required\";b:0;s:5:\"label\";s:10:\"Para image\";s:9:\"microcopy\";s:0:\"\";}i:7;O:8:\"stdClass\":9:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:15:\"el1503046917174\";s:8:\"required\";b:0;s:5:\"label\";s:11:\"Para 2 text\";s:5:\"value\";s:16:\"<p>\n \n</p>\";s:9:\"microcopy\";s:0:\"\";s:10:\"limit_type\";s:5:\"words\";s:5:\"limit\";i:0;s:10:\"plain_text\";b:0;}i:8;O:8:\"stdClass\":4:{s:4:\"type\";s:7:\"section\";s:4:\"name\";s:15:\"el1503050151209\";s:5:\"title\";s:5:\"Guide\";s:8:\"subtitle\";s:10:\"<p>​</p>\";}}}i:1;O:8:\"stdClass\":4:{s:5:\"label\";s:2:\"HU\";s:4:\"name\";s:16:\"tab1503046938794\";s:6:\"hidden\";b:0;s:8:\"elements\";a:9:{i:0;O:8:\"stdClass\":9:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:15:\"el1503046938794\";s:8:\"required\";b:0;s:5:\"label\";s:5:\"Title\";s:5:\"value\";s:0:\"\";s:9:\"microcopy\";s:0:\"\";s:10:\"limit_type\";s:5:\"words\";s:5:\"limit\";i:0;s:10:\"plain_text\";b:1;}i:1;O:8:\"stdClass\":9:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:15:\"el1503046938795\";s:8:\"required\";b:0;s:5:\"label\";s:4:\"Body\";s:5:\"value\";s:16:\"<p>\n \n</p>\";s:9:\"microcopy\";s:0:\"\";s:10:\"limit_type\";s:5:\"words\";s:5:\"limit\";i:0;s:10:\"plain_text\";b:0;}i:2;O:8:\"stdClass\":5:{s:4:\"type\";s:5:\"files\";s:4:\"name\";s:15:\"el1503046938796\";s:8:\"required\";b:0;s:5:\"label\";s:5:\"Image\";s:9:\"microcopy\";s:0:\"\";}i:3;O:8:\"stdClass\":7:{s:4:\"type\";s:12:\"choice_radio\";s:4:\"name\";s:15:\"el1503046938797\";s:8:\"required\";b:0;s:5:\"label\";s:5:\"Radio\";s:9:\"microcopy\";s:0:\"\";s:12:\"other_option\";b:0;s:7:\"options\";a:3:{i:0;O:8:\"stdClass\":3:{s:4:\"name\";s:19:\"op15030467537046960\";s:5:\"label\";s:12:\"First choice\";s:8:\"selected\";b:0;}i:1;O:8:\"stdClass\":3:{s:4:\"name\";s:19:\"op15030467537057882\";s:5:\"label\";s:13:\"Second choice\";s:8:\"selected\";b:0;}i:2;O:8:\"stdClass\":3:{s:4:\"name\";s:19:\"op15030467537069199\";s:5:\"label\";s:12:\"Third choice\";s:8:\"selected\";b:0;}}}i:4;O:8:\"stdClass\":6:{s:4:\"type\";s:15:\"choice_checkbox\";s:4:\"name\";s:15:\"el1503046938798\";s:8:\"required\";b:0;s:5:\"label\";s:10:\"Checkboxes\";s:9:\"microcopy\";s:0:\"\";s:7:\"options\";a:2:{i:0;O:8:\"stdClass\":3:{s:4:\"name\";s:18:\"op1503046763383887\";s:5:\"label\";s:7:\"Choice1\";s:8:\"selected\";b:0;}i:1;O:8:\"stdClass\":3:{s:4:\"name\";s:18:\"op1503046763384321\";s:5:\"label\";s:7:\"Choice2\";s:8:\"selected\";b:0;}}}i:5;O:8:\"stdClass\":9:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:15:\"el1503046938799\";s:8:\"required\";b:0;s:5:\"label\";s:9:\"Para text\";s:5:\"value\";s:16:\"<p>\n \n</p>\";s:9:\"microcopy\";s:0:\"\";s:10:\"limit_type\";s:5:\"words\";s:5:\"limit\";i:0;s:10:\"plain_text\";b:0;}i:6;O:8:\"stdClass\":5:{s:4:\"type\";s:5:\"files\";s:4:\"name\";s:15:\"el1503046938800\";s:8:\"required\";b:0;s:5:\"label\";s:10:\"Para image\";s:9:\"microcopy\";s:0:\"\";}i:7;O:8:\"stdClass\":9:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:15:\"el1503046938801\";s:8:\"required\";b:0;s:5:\"label\";s:11:\"Para 2 text\";s:5:\"value\";s:16:\"<p>\n \n</p>\";s:9:\"microcopy\";s:0:\"\";s:10:\"limit_type\";s:5:\"words\";s:5:\"limit\";i:0;s:10:\"plain_text\";b:0;}i:8;O:8:\"stdClass\":4:{s:4:\"type\";s:7:\"section\";s:4:\"name\";s:15:\"el1503050171534\";s:5:\"title\";s:10:\"Guidelines\";s:8:\"subtitle\";s:0:\"\";}}}}}}"
migration_definitions:
- 86701_821317_node_article_tab1502959217871
- 86701_821317_node_article_tab1503046938794
- 86701_821317_node_article_tab1503046938795
uuid: e1c0686d-87a7-478e-894f-592d17785214
langcode: en-gb
status: true
dependencies: { }
id: 86701_821317_node_article_engb
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: { }
migration_group: null
label: 'Andor''s project_Simple multilang_node_engb'
source:
plugin: content_workflow_bynder_migration
projectId: 86701
templateId: 821317
templateName: 'Simple multilang'
fields:
- el1503046938794
- el1503046938795
metatagFields: { }
process:
type:
plugin: default_value
default_value: article
title:
plugin: content_workflow_bynder_get
source: el1503046938794
language: en-gb
body:
plugin: content_workflow_bynder_get
source: el1503046938795
language: en-gb
nid:
plugin: migration_lookup
source: id
migration: 86701_821317_node_article_en
langcode:
plugin: default_value
default_value: en-gb
destination:
plugin: 'cwb_entity:node'
translations: true
migration_dependencies:
optional:
- 86701_821317_node_article_en
......@@ -17,6 +17,7 @@ class ConfigCreatorTest extends CwbMigrateTestBase {
'821317' => [
'migrate_plus.migration.86701_821317_node_article_en' => 'test1.1.yml',
'migrate_plus.migration.86701_821317_node_article_hu' => 'test1.2.yml',
'migrate_plus.migration.86701_821317_node_article_engb' => 'test1.3.yml',
],
'819462' => [
'migrate_plus.migration.86701_819462_node_simple_test_type_en' => 'test1.1.yml',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment