Commit d1f6df12 authored by Dries's avatar Dries

Issue #2281443 by ultimike, TommyK: Fixed D6 Workflow settings -> D8...

Issue #2281443 by ultimike, TommyK: Fixed D6 Workflow settings -> D8 Publishing options not migrating.
parent 900784f7
......@@ -14,9 +14,9 @@ process:
description: description
help: help
title_label: title_label
preview: 'constants/preview'
submitted: submitted
options: options
'settings/node/preview': 'constants/preview'
'settings/node/submitted': submitted
'settings/node/options': options
create_body: has_body
create_body_label: body_label
destination:
......
......@@ -103,9 +103,10 @@ public function prepareRow(Row $row) {
$row->setSourceProperty('node_preview', $this->nodePreview);
$type = $row->getSourceProperty('type');
$options = $this->variableGet('node_options_' . $type, array('promote', 'sticky'));
$source_options = $this->variableGet('node_options_' . $type, array('promote', 'sticky'));
$options = array();
foreach (array('promote', 'sticky', 'status', 'revision') as $item) {
$options[$item] = isset($options[$item]);
$options[$item] = in_array($item, $source_options);
}
$row->setSourceProperty('options', $options);
$submitted = isset($this->themeSettings['toggle_node_info_' . $type]) ? $this->themeSettings['toggle_node_info_' . $type] : FALSE;
......
......@@ -65,6 +65,22 @@ public function load() {
'locked' => 0,
'orig_type' => 'story',
))
->values(array(
'type' => 'test_event',
'name' => 'Migrate test event',
'module' => 'node',
'description' => "test event description here",
'help' => 'help text here',
'has_title' => 1,
'title_label' => 'Event Name',
'has_body' => 1,
'body_label' => 'Body',
'min_word_count' => 0,
'custom' => 1,
'modified' => 1,
'locked' => 0,
'orig_type' => 'event',
))
->execute();
$this->database->merge('node_type')
......@@ -92,7 +108,7 @@ public function load() {
'value',
))
->values(array(
'name' => 'node_options_migrate_test_page',
'name' => 'node_options_test_page',
'value' => serialize(array(
0 => 'status',
1 => 'promote',
......@@ -100,12 +116,19 @@ public function load() {
)),
))
->values(array(
'name' => 'node_options_migrate_test_story',
'name' => 'node_options_test_story',
'value' => serialize(array(
0 => 'status',
1 => 'promote',
)),
))
->values(array(
'name' => 'node_options_test_event',
'value' => serialize(array(
0 => 'sticky',
1 => 'revision',
)),
))
->values(array(
'name' => 'theme_settings',
'value' => serialize(array(
......@@ -127,8 +150,9 @@ public function load() {
'default_favicon' => 1,
'favicon_path' => '',
'favicon_upload' => '',
'toggle_node_info_migrate_test_page' => 1,
'toggle_node_info_migrate_test_story' => 1,
'toggle_node_info_test_page' => 1,
'toggle_node_info_test_story' => 1,
'toggle_node_info_test_event' => 1,
)),
))
->execute();
......
......@@ -51,7 +51,7 @@ public function testNodeType() {
'options' => array(
'status' => TRUE,
'promote' => TRUE,
'sticky' => FALSE,
'sticky' => TRUE,
'revision' => FALSE,
),
'preview' => 1,
......@@ -78,11 +78,32 @@ public function testNodeType() {
'preview' => 1,
'submitted' => TRUE,
);
$this->assertEqual($node_type_page->settings['node'], $expected, 'Node type test_page settings correct.');
$this->assertEqual($node_type_story->settings['node'], $expected, 'Node type test_story settings correct.');
$this->assertEqual(array('test_story'), $migration->getIdMap()->lookupDestinationID(array('test_story')));
// Test we don't have a body field.
$instance = FieldInstanceConfig::loadByName('node', 'test_story', 'body');
$this->assertEqual($instance, NULL, 'No body field found');
// Test the test_event content type.
$node_type_event = entity_load('node_type', 'test_event');
$this->assertEqual($node_type_event->id(), 'test_event', 'Node type test_event loaded');
$expected = array(
'options' => array(
'status' => FALSE,
'promote' => FALSE,
'sticky' => TRUE,
'revision' => TRUE,
),
'preview' => 1,
'submitted' => TRUE,
);
$this->assertEqual($node_type_event->settings['node'], $expected, 'Node type test_event settings correct.');
$this->assertEqual(array('test_event'), $migration->getIdMap()->lookupDestinationID(array('test_event')));
// Test we have a body field.
$instance = FieldInstanceConfig::loadByName('node', 'test_event', 'body');
$this->assertEqual($instance->getLabel(), 'Body', 'Body field was found.');
}
}
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