Commit c2ea8a58 authored by webchick's avatar webchick

Issue #3097327 by Wim Leers, quietone, Meenakshi.g: d7_node_title_label...

Issue #3097327 by Wim Leers, quietone, Meenakshi.g: d7_node_title_label migration plugin incorrectly generating base_field_override for every node type, even those that don't have an overridden title label
parent 60b75a6d
......@@ -101,7 +101,7 @@ protected function getEntityCounts() {
'entity_form_mode' => 1,
'entity_view_display' => 31,
'entity_view_mode' => 14,
'base_field_override' => 9,
'base_field_override' => 4,
];
}
......
......@@ -9,10 +9,19 @@ source:
entity_type: node
field_name: title
process:
label:
-
plugin: static_map
source: title_label
bypass: true
map:
Title: 0
-
plugin: skip_on_empty
method: row
entity_type: 'constants/entity_type'
bundle: type
field_name: 'constants/field_name'
label: title_label
destination:
plugin: entity:base_field_override
migration_dependencies:
......
......@@ -42,12 +42,20 @@ protected function assertEntity($id, $label) {
* Tests migration of node title field overrides.
*/
public function testMigration() {
$this->assertEntity('node.article.title', 'Title');
$this->assertEntity('node.blog.title', 'Title');
$this->assertEntity('node.book.title', 'Title');
// Forum title labels are overridden to 'Subject'.
$this->assertEntity('node.forum.title', 'Subject');
$this->assertEntity('node.page.title', 'Title');
$this->assertEntity('node.test_content_type.title', 'Title');
// Other content types use the default of 'Title' and are not overridden.
$no_override_node_type = [
'article',
'blog',
'book',
'page',
'test_content_type',
];
foreach ($no_override_node_type as $type) {
$override = BaseFieldOverride::load("node.$type.title");
$this->assertFalse($override instanceof BaseFieldOverride);
}
}
}
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