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
60b75a6d52
commit
c2ea8a58aa
|
@ -101,7 +101,7 @@ class Upgrade7Test extends MigrateUpgradeExecuteTestBase {
|
||||||
'entity_form_mode' => 1,
|
'entity_form_mode' => 1,
|
||||||
'entity_view_display' => 31,
|
'entity_view_display' => 31,
|
||||||
'entity_view_mode' => 14,
|
'entity_view_mode' => 14,
|
||||||
'base_field_override' => 9,
|
'base_field_override' => 4,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,19 @@ source:
|
||||||
entity_type: node
|
entity_type: node
|
||||||
field_name: title
|
field_name: title
|
||||||
process:
|
process:
|
||||||
|
label:
|
||||||
|
-
|
||||||
|
plugin: static_map
|
||||||
|
source: title_label
|
||||||
|
bypass: true
|
||||||
|
map:
|
||||||
|
Title: 0
|
||||||
|
-
|
||||||
|
plugin: skip_on_empty
|
||||||
|
method: row
|
||||||
entity_type: 'constants/entity_type'
|
entity_type: 'constants/entity_type'
|
||||||
bundle: type
|
bundle: type
|
||||||
field_name: 'constants/field_name'
|
field_name: 'constants/field_name'
|
||||||
label: title_label
|
|
||||||
destination:
|
destination:
|
||||||
plugin: entity:base_field_override
|
plugin: entity:base_field_override
|
||||||
migration_dependencies:
|
migration_dependencies:
|
||||||
|
|
|
@ -42,12 +42,20 @@ class MigrateNodeTitleLabelTest extends MigrateDrupal7TestBase {
|
||||||
* Tests migration of node title field overrides.
|
* Tests migration of node title field overrides.
|
||||||
*/
|
*/
|
||||||
public function testMigration() {
|
public function testMigration() {
|
||||||
$this->assertEntity('node.article.title', 'Title');
|
// Forum title labels are overridden to 'Subject'.
|
||||||
$this->assertEntity('node.blog.title', 'Title');
|
|
||||||
$this->assertEntity('node.book.title', 'Title');
|
|
||||||
$this->assertEntity('node.forum.title', 'Subject');
|
$this->assertEntity('node.forum.title', 'Subject');
|
||||||
$this->assertEntity('node.page.title', 'Title');
|
// Other content types use the default of 'Title' and are not overridden.
|
||||||
$this->assertEntity('node.test_content_type.title', 'Title');
|
$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue