Issue #2333985 by quietone, jarsenx, ultimike, heddn: Migrate menu_default_node_menu setting
parent
8938ab2906
commit
5875eb523c
|
@ -15,7 +15,7 @@ class MigrateBookTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['book'];
|
public static $modules = ['book', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -17,7 +17,7 @@ class MigrateCommentTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['comment'];
|
public static $modules = ['comment', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -11,6 +11,11 @@ use Drupal\Core\Entity\Entity\EntityViewDisplay;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisplayBase {
|
class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisplayBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -11,6 +11,11 @@ use Drupal\Core\Entity\Entity\EntityFormDisplay;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariableDisplayBase {
|
class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariableDisplayBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MigrateCommentVariableFieldTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['comment'];
|
public static $modules = ['comment', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -16,7 +16,7 @@ class MigrateCommentVariableInstanceTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['comment'];
|
public static $modules = ['comment', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentEntityDisplayTest extends MigrateDrupal7TestBase {
|
class MigrateCommentEntityDisplayTest extends MigrateDrupal7TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'comment', 'text'];
|
public static $modules = ['node', 'comment', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal7TestBase {
|
class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal7TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'comment', 'text'];
|
public static $modules = ['node', 'comment', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentEntityFormDisplayTest extends MigrateDrupal7TestBase {
|
class MigrateCommentEntityFormDisplayTest extends MigrateDrupal7TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'comment', 'text'];
|
public static $modules = ['node', 'comment', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentFieldInstanceTest extends MigrateDrupal7TestBase {
|
class MigrateCommentFieldInstanceTest extends MigrateDrupal7TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'comment', 'text'];
|
public static $modules = ['node', 'comment', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentFieldTest extends MigrateDrupal7TestBase {
|
class MigrateCommentFieldTest extends MigrateDrupal7TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'comment', 'text'];
|
public static $modules = ['node', 'comment', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -14,7 +14,7 @@ use Drupal\node\NodeInterface;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentTest extends MigrateDrupal7TestBase {
|
class MigrateCommentTest extends MigrateDrupal7TestBase {
|
||||||
|
|
||||||
public static $modules = ['filter', 'node', 'comment', 'text'];
|
public static $modules = ['filter', 'node', 'comment', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -13,7 +13,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateCommentTypeTest extends MigrateDrupal7TestBase {
|
class MigrateCommentTypeTest extends MigrateDrupal7TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'comment', 'text'];
|
public static $modules = ['node', 'comment', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -12,6 +12,11 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase {
|
class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -14,6 +14,11 @@ use Drupal\node\Entity\Node;
|
||||||
*/
|
*/
|
||||||
class MigrateFieldInstanceTest extends MigrateDrupal6TestBase {
|
class MigrateFieldInstanceTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests migration of file variables to file.settings.yml.
|
* Tests migration of file variables to file.settings.yml.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,6 +12,11 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateFieldWidgetSettingsTest extends MigrateDrupal6TestBase {
|
class MigrateFieldWidgetSettingsTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -29,6 +29,7 @@ class MigrateFieldInstanceWidgetSettingsTest extends MigrateDrupal7TestBase {
|
||||||
'taxonomy',
|
'taxonomy',
|
||||||
'telephone',
|
'telephone',
|
||||||
'text',
|
'text',
|
||||||
|
'menu_ui',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,6 +12,11 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateUploadEntityDisplayTest extends MigrateDrupal6TestBase {
|
class MigrateUploadEntityDisplayTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,6 +12,11 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateUploadEntityFormDisplayTest extends MigrateDrupal6TestBase {
|
class MigrateUploadEntityFormDisplayTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,6 +12,11 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateUploadFieldTest extends MigrateDrupal6TestBase {
|
class MigrateUploadFieldTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,6 +12,11 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateUploadInstanceTest extends MigrateDrupal6TestBase {
|
class MigrateUploadInstanceTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,6 +13,11 @@ use Drupal\node\Entity\Node;
|
||||||
*/
|
*/
|
||||||
class MigrateUploadTest extends MigrateDrupal6TestBase {
|
class MigrateUploadTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,7 +16,7 @@ class MigrateLanguageContentSettingsTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['node', 'text', 'language', 'content_translation'];
|
public static $modules = ['node', 'text', 'language', 'content_translation', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -16,7 +16,7 @@ class MigrateLanguageContentSettingsTest extends MigrateDrupal7TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['node', 'text', 'language', 'content_translation'];
|
public static $modules = ['node', 'text', 'language', 'content_translation', 'menu_ui'];
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -46081,6 +46081,10 @@ $connection->insert('variable')
|
||||||
'name',
|
'name',
|
||||||
'value',
|
'value',
|
||||||
))
|
))
|
||||||
|
->values(array(
|
||||||
|
'name' => 'menu_default_node_menu',
|
||||||
|
'value' => 's:10:"navigation";',
|
||||||
|
))
|
||||||
->values(array(
|
->values(array(
|
||||||
'name' => 'actions_max_stack',
|
'name' => 'actions_max_stack',
|
||||||
'value' => 'i:35;',
|
'value' => 'i:35;',
|
||||||
|
|
|
@ -20,5 +20,7 @@ process:
|
||||||
'settings/node/options': options
|
'settings/node/options': options
|
||||||
create_body: has_body
|
create_body: has_body
|
||||||
create_body_label: body_label
|
create_body_label: body_label
|
||||||
|
'third_party_settings/menu_ui/available_menus': available_menus
|
||||||
|
'third_party_settings/menu_ui/parent': parent
|
||||||
destination:
|
destination:
|
||||||
plugin: entity:node_type
|
plugin: entity:node_type
|
||||||
|
|
|
@ -17,5 +17,7 @@ process:
|
||||||
new_revision: 'options/revision'
|
new_revision: 'options/revision'
|
||||||
create_body: create_body
|
create_body: create_body
|
||||||
create_body_label: body_label
|
create_body_label: body_label
|
||||||
|
'third_party_settings/menu_ui/available_menus': available_menus
|
||||||
|
'third_party_settings/menu_ui/parent': parent
|
||||||
destination:
|
destination:
|
||||||
plugin: entity:node_type
|
plugin: entity:node_type
|
||||||
|
|
|
@ -107,6 +107,10 @@ class NodeType extends DrupalSqlBase {
|
||||||
$submitted = isset($this->themeSettings['toggle_node_info_' . $type]) ? $this->themeSettings['toggle_node_info_' . $type] : FALSE;
|
$submitted = isset($this->themeSettings['toggle_node_info_' . $type]) ? $this->themeSettings['toggle_node_info_' . $type] : FALSE;
|
||||||
$row->setSourceProperty('display_submitted', $submitted);
|
$row->setSourceProperty('display_submitted', $submitted);
|
||||||
|
|
||||||
|
if ($default_node_menu = $this->variableGet('menu_default_node_menu', NULL)) {
|
||||||
|
$row->setSourceProperty('available_menus', [$default_node_menu]);
|
||||||
|
$row->setSourceProperty('parent', $default_node_menu . ':');
|
||||||
|
}
|
||||||
return parent::prepareRow($row);
|
return parent::prepareRow($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,12 @@ class NodeType extends DrupalSqlBase {
|
||||||
|
|
||||||
$row->setSourceProperty('display_submitted', $this->variableGet('node_submitted_' . $type, TRUE));
|
$row->setSourceProperty('display_submitted', $this->variableGet('node_submitted_' . $type, TRUE));
|
||||||
|
|
||||||
|
if ($menu_options = $this->variableGet('menu_options_' . $type, NULL)) {
|
||||||
|
$row->setSourceProperty('available_menus', $menu_options);
|
||||||
|
}
|
||||||
|
if ($parent = $this->variableGet('menu_parent_' . $type, NULL)) {
|
||||||
|
$row->setSourceProperty('parent', $parent . ':');
|
||||||
|
}
|
||||||
return parent::prepareRow($row);
|
return parent::prepareRow($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class MigrateNodeRevisionTest extends MigrateNodeTestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['language', 'content_translation'];
|
public static $modules = ['language', 'content_translation', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -13,6 +13,11 @@ use Drupal\node\Entity\Node;
|
||||||
*/
|
*/
|
||||||
class MigrateNodeBundleSettingsTest extends MigrateDrupal6TestBase {
|
class MigrateNodeBundleSettingsTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateNodeSettingPromoteTest extends MigrateDrupal6TestBase {
|
class MigrateNodeSettingPromoteTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'text'];
|
public static $modules = ['node', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateNodeSettingStatusTest extends MigrateDrupal6TestBase {
|
class MigrateNodeSettingStatusTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'text'];
|
public static $modules = ['node', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateNodeSettingStickyTest extends MigrateDrupal6TestBase {
|
class MigrateNodeSettingStickyTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'text'];
|
public static $modules = ['node', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -19,7 +19,7 @@ class MigrateNodeTest extends MigrateNodeTestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['language', 'content_translation'];
|
public static $modules = ['language', 'content_translation', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -13,6 +13,11 @@ use Drupal\node\Entity\NodeType;
|
||||||
*/
|
*/
|
||||||
class MigrateNodeTypeTest extends MigrateDrupal6TestBase {
|
class MigrateNodeTypeTest extends MigrateDrupal6TestBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static $modules = ['menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@ -39,6 +44,12 @@ class MigrateNodeTypeTest extends MigrateDrupal6TestBase {
|
||||||
$field = FieldConfig::loadByName('node', 'test_page', 'body');
|
$field = FieldConfig::loadByName('node', 'test_page', 'body');
|
||||||
$this->assertIdentical('This is the body field label', $field->getLabel(), 'Body field was found.');
|
$this->assertIdentical('This is the body field label', $field->getLabel(), 'Body field was found.');
|
||||||
|
|
||||||
|
// Test default menus.
|
||||||
|
$expected_available_menus = ['navigation'];
|
||||||
|
$this->assertSame($expected_available_menus, $node_type_page->getThirdPartySetting('menu_ui', 'available_menus'));
|
||||||
|
$expected_parent = 'navigation:';
|
||||||
|
$this->assertSame($expected_parent, $node_type_page->getThirdPartySetting('menu_ui', 'parent'));
|
||||||
|
|
||||||
// Test the test_story content type.
|
// Test the test_story content type.
|
||||||
$node_type_story = NodeType::load('test_story');
|
$node_type_story = NodeType::load('test_story');
|
||||||
$this->assertIdentical('test_story', $node_type_story->id(), 'Node type test_story loaded');
|
$this->assertIdentical('test_story', $node_type_story->id(), 'Node type test_story loaded');
|
||||||
|
@ -52,6 +63,12 @@ class MigrateNodeTypeTest extends MigrateDrupal6TestBase {
|
||||||
$field = FieldConfig::loadByName('node', 'test_story', 'body');
|
$field = FieldConfig::loadByName('node', 'test_story', 'body');
|
||||||
$this->assertIdentical(NULL, $field, 'No body field found');
|
$this->assertIdentical(NULL, $field, 'No body field found');
|
||||||
|
|
||||||
|
// Test default menus.
|
||||||
|
$expected_available_menus = ['navigation'];
|
||||||
|
$this->assertSame($expected_available_menus, $node_type_story->getThirdPartySetting('menu_ui', 'available_menus'));
|
||||||
|
$expected_parent = 'navigation:';
|
||||||
|
$this->assertSame($expected_parent, $node_type_story->getThirdPartySetting('menu_ui', 'parent'));
|
||||||
|
|
||||||
// Test the test_event content type.
|
// Test the test_event content type.
|
||||||
$node_type_event = NodeType::load('test_event');
|
$node_type_event = NodeType::load('test_event');
|
||||||
$this->assertIdentical('test_event', $node_type_event->id(), 'Node type test_event loaded');
|
$this->assertIdentical('test_event', $node_type_event->id(), 'Node type test_event loaded');
|
||||||
|
@ -64,6 +81,11 @@ class MigrateNodeTypeTest extends MigrateDrupal6TestBase {
|
||||||
// Test we have a body field.
|
// Test we have a body field.
|
||||||
$field = FieldConfig::loadByName('node', 'test_event', 'body');
|
$field = FieldConfig::loadByName('node', 'test_event', 'body');
|
||||||
$this->assertIdentical('Body', $field->getLabel(), 'Body field was found.');
|
$this->assertIdentical('Body', $field->getLabel(), 'Body field was found.');
|
||||||
|
|
||||||
|
$expected_available_menus = ['navigation'];
|
||||||
|
$this->assertSame($expected_available_menus, $node_type_event->getThirdPartySetting('menu_ui', 'available_menus'));
|
||||||
|
$expected_parent = 'navigation:';
|
||||||
|
$this->assertSame($expected_parent, $node_type_event->getThirdPartySetting('menu_ui', 'parent'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ class MigrateNodeTest extends MigrateDrupal7TestBase {
|
||||||
'image',
|
'image',
|
||||||
'language',
|
'language',
|
||||||
'link',
|
'link',
|
||||||
|
'menu_ui',
|
||||||
'node',
|
'node',
|
||||||
'taxonomy',
|
'taxonomy',
|
||||||
'telephone',
|
'telephone',
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||||
*/
|
*/
|
||||||
class MigrateNodeTitleLabelTest extends MigrateDrupal7TestBase {
|
class MigrateNodeTitleLabelTest extends MigrateDrupal7TestBase {
|
||||||
|
|
||||||
public static $modules = ['node', 'text'];
|
public static $modules = ['node', 'text', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -20,7 +20,7 @@ class MigrateNodeTypeTest extends MigrateDrupal7TestBase {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $modules = ['node', 'text', 'filter'];
|
public static $modules = ['node', 'text', 'filter', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
@ -45,12 +45,13 @@ class MigrateNodeTypeTest extends MigrateDrupal7TestBase {
|
||||||
* @param string $help
|
* @param string $help
|
||||||
* The expected help text.
|
* The expected help text.
|
||||||
*/
|
*/
|
||||||
protected function assertEntity($id, $label, $description, $help, $display_submitted, $new_revision, $body_label = NULL) {
|
protected function assertEntity($id, $label, $description, $help, $display_submitted, $new_revision, $expected_available_menus, $expected_parent, $body_label = NULL) {
|
||||||
/** @var \Drupal\node\NodeTypeInterface $entity */
|
/** @var \Drupal\node\NodeTypeInterface $entity */
|
||||||
$entity = NodeType::load($id);
|
$entity = NodeType::load($id);
|
||||||
$this->assertTrue($entity instanceof NodeTypeInterface);
|
$this->assertTrue($entity instanceof NodeTypeInterface);
|
||||||
$this->assertIdentical($label, $entity->label());
|
$this->assertIdentical($label, $entity->label());
|
||||||
$this->assertIdentical($description, $entity->getDescription());
|
$this->assertIdentical($description, $entity->getDescription());
|
||||||
|
|
||||||
$this->assertIdentical($help, $entity->getHelp());
|
$this->assertIdentical($help, $entity->getHelp());
|
||||||
|
|
||||||
$this->assertIdentical($display_submitted, $entity->displaySubmitted(), 'Submission info is displayed');
|
$this->assertIdentical($display_submitted, $entity->displaySubmitted(), 'Submission info is displayed');
|
||||||
|
@ -62,20 +63,32 @@ class MigrateNodeTypeTest extends MigrateDrupal7TestBase {
|
||||||
$this->assertTrue($body instanceof FieldConfigInterface);
|
$this->assertTrue($body instanceof FieldConfigInterface);
|
||||||
$this->assertIdentical($body_label, $body->label());
|
$this->assertIdentical($body_label, $body->label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->assertSame($expected_available_menus, $entity->getThirdPartySetting('menu_ui', 'available_menus'));
|
||||||
|
$this->assertSame($expected_parent, $entity->getThirdPartySetting('menu_ui', 'parent'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests Drupal 7 node type to Drupal 8 migration.
|
* Tests Drupal 7 node type to Drupal 8 migration.
|
||||||
*/
|
*/
|
||||||
public function testNodeType() {
|
public function testNodeType() {
|
||||||
$this->assertEntity('article', 'Article', 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.', 'Help text for articles', TRUE, FALSE, "Body");
|
$expected_available_menus = ['main-menu'];
|
||||||
$this->assertEntity('blog', 'Blog entry', 'Use for multi-user blogs. Every user gets a personal blog.', 'Blog away, good sir!', TRUE, FALSE, 'Body');
|
$expected_parent = 'main-menu:0:';
|
||||||
|
|
||||||
|
$this->assertEntity('article', 'Article', 'Use <em>articles</em> for time-sensitive content like news, press releases or blog posts.', 'Help text for articles', TRUE, FALSE, $expected_available_menus, $expected_parent, "Body");
|
||||||
|
$this->assertEntity('blog', 'Blog entry', 'Use for multi-user blogs. Every user gets a personal blog.', 'Blog away, good sir!', TRUE, FALSE, $expected_available_menus, $expected_parent, 'Body');
|
||||||
// book's display_submitted flag is not set, so it will default to TRUE.
|
// book's display_submitted flag is not set, so it will default to TRUE.
|
||||||
$this->assertEntity('book', 'Book page', '<em>Books</em> have a built-in hierarchical navigation. Use for handbooks or tutorials.', '', TRUE, TRUE, "Body");
|
$this->assertEntity('book', 'Book page', '<em>Books</em> have a built-in hierarchical navigation. Use for handbooks or tutorials.', '', TRUE, TRUE, $expected_available_menus, $expected_parent, "Body");
|
||||||
$this->assertEntity('forum', 'Forum topic', 'A <em>forum topic</em> starts a new discussion thread within a forum.', 'No name-calling, no flame wars. Be nice.', TRUE, FALSE, 'Body');
|
$this->assertEntity('forum', 'Forum topic', 'A <em>forum topic</em> starts a new discussion thread within a forum.', 'No name-calling, no flame wars. Be nice.', TRUE, FALSE, $expected_available_menus, $expected_parent, 'Body');
|
||||||
$this->assertEntity('page', 'Basic page', "Use <em>basic pages</em> for your static content, such as an 'About us' page.", 'Help text for basic pages', FALSE, FALSE, "Body");
|
$this->assertEntity('page', 'Basic page', "Use <em>basic pages</em> for your static content, such as an 'About us' page.", 'Help text for basic pages', FALSE, FALSE, $expected_available_menus, $expected_parent, "Body");
|
||||||
// This node type does not carry a body field.
|
// This node type does not carry a body field.
|
||||||
$this->assertEntity('test_content_type', 'Test content type', 'This is the description of the test content type.', 'Help text for test content type', FALSE, TRUE);
|
$expected_available_menus = [
|
||||||
|
'main-menu',
|
||||||
|
'management',
|
||||||
|
'navigation',
|
||||||
|
'user-menu',
|
||||||
|
];
|
||||||
|
$this->assertEntity('test_content_type', 'Test content type', 'This is the description of the test content type.', 'Help text for test content type', FALSE, TRUE, $expected_available_menus, $expected_parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ class MigrateUrlAliasTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['language', 'content_translation', 'path'];
|
public static $modules = ['language', 'content_translation', 'path', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -17,6 +17,7 @@ class MigrateUrlAliasTest extends MigrateDrupal7TestBase {
|
||||||
public static $modules = [
|
public static $modules = [
|
||||||
'content_translation',
|
'content_translation',
|
||||||
'language',
|
'language',
|
||||||
|
'menu_ui',
|
||||||
'node',
|
'node',
|
||||||
'path',
|
'path',
|
||||||
'text',
|
'text',
|
||||||
|
|
|
@ -14,7 +14,7 @@ class MigrateTermNodeRevisionTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['taxonomy'];
|
public static $modules = ['taxonomy', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MigrateTermNodeTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['taxonomy'];
|
public static $modules = ['taxonomy', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MigrateVocabularyEntityDisplayTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['field', 'taxonomy'];
|
public static $modules = ['field', 'taxonomy', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MigrateVocabularyEntityFormDisplayTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['taxonomy'];
|
public static $modules = ['taxonomy', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MigrateVocabularyFieldInstanceTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['taxonomy'];
|
public static $modules = ['taxonomy', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MigrateVocabularyFieldTest extends MigrateDrupal6TestBase {
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = ['taxonomy'];
|
public static $modules = ['taxonomy', 'menu_ui'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
|
@ -20,6 +20,7 @@ class MigrateNodeTaxonomyTest extends MigrateDrupal7TestBase {
|
||||||
'filter',
|
'filter',
|
||||||
'image',
|
'image',
|
||||||
'link',
|
'link',
|
||||||
|
'menu_ui',
|
||||||
'node',
|
'node',
|
||||||
'taxonomy',
|
'taxonomy',
|
||||||
'telephone',
|
'telephone',
|
||||||
|
|
|
@ -18,6 +18,7 @@ class MigrateTaxonomyTermTest extends MigrateDrupal7TestBase {
|
||||||
'datetime',
|
'datetime',
|
||||||
'image',
|
'image',
|
||||||
'link',
|
'link',
|
||||||
|
'menu_ui',
|
||||||
'node',
|
'node',
|
||||||
'taxonomy',
|
'taxonomy',
|
||||||
'telephone',
|
'telephone',
|
||||||
|
|
|
@ -16,6 +16,7 @@ class MigrateTrackerNodeTest extends MigrateDrupal7TestBase {
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = [
|
public static $modules = [
|
||||||
|
'menu_ui',
|
||||||
'node',
|
'node',
|
||||||
'text',
|
'text',
|
||||||
'tracker',
|
'tracker',
|
||||||
|
|
|
@ -16,6 +16,7 @@ class MigrateTrackerUserTest extends MigrateDrupal7TestBase {
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public static $modules = [
|
public static $modules = [
|
||||||
|
'menu_ui',
|
||||||
'node',
|
'node',
|
||||||
'text',
|
'text',
|
||||||
'tracker',
|
'tracker',
|
||||||
|
|
Loading…
Reference in New Issue