Commit acf07373 authored by Dries's avatar Dries

- Patch #1263208 by Niklas Fiekas, BTMash, aiwata55, Berdir, kathyh: upgrade...

- Patch #1263208 by Niklas Fiekas, BTMash, aiwata55, Berdir, kathyh: upgrade path for blog module removal.
parent a478badb
......@@ -84,5 +84,11 @@ public function testBasicStandardUpgrade() {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
// Verify that the blog node type has been assigned to node module.
$blog_type = node_type_load('blog');
$this->assertEqual($blog_type->module, 'node', "Content type 'blog' has been reassigned from the blog module to the node module.");
$this->assertEqual($blog_type->base, 'node_content', "The base string used to construct callbacks corresponding to content type 'Blog' has been reassigned to 'node_content'.");
}
}
......@@ -84,5 +84,10 @@ public function testFilledStandardUpgrade() {
// Confirm that no {menu_links} entry exists for user/autocomplete.
$result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
$this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
// Verify that the blog node type has been assigned to node module.
$blog_type = node_type_load('blog');
$this->assertEqual($blog_type->module, 'node', "Content type 'blog' has been reassigned from the blog module to the node module.");
$this->assertEqual($blog_type->base, 'node_content', "The base string used to construct callbacks corresponding to content type 'Blog' has been reassigned to 'node_content'.");
}
}
......@@ -46,8 +46,8 @@ public function testLanguageUpgrade() {
}
// Check that both comments display on the node.
$this->drupalGet('node/38');
$this->assertText('Node title 38', t('Node 38 displayed after update.'));
$this->drupalGet('node/50');
$this->assertText('Node title 50', t('Node 50 displayed after update.'));
$this->assertText('First test comment', t('Comment 1 displayed after update.'));
$this->assertText('Reply to first test comment', t('Comment 2 displayed after update.'));
......@@ -61,10 +61,10 @@ public function testLanguageUpgrade() {
$this->assertTrue($this->xpath('//div[@id="block-language-language-interface"]'), t('The language switcher block is being correctly showed.'));
// Test that the 'language' property was properly renamed to 'langcode'.
$language_none_nid = 38;
$spanish_nid = 39;
$translation_source_nid = 40;
$translation_nid = 41;
$language_none_nid = 50;
$spanish_nid = 51;
$translation_source_nid = 52;
$translation_nid = 53;
// Check directly for the $node->langcode property.
$this->assertEqual(node_load($language_none_nid)->langcode, LANGUAGE_NOT_SPECIFIED, "'language' property was renamed to 'langcode' for LANGUAGE_NOT_SPECIFIED node.");
$this->assertEqual(node_load($spanish_nid)->langcode, 'ca', "'language' property was renamed to 'langcode' for Catalan node.");
......
......@@ -1924,6 +1924,19 @@ function system_update_8010() {
));
}
/**
* Update the module and base fields for the blog node type.
*/
function system_update_8011() {
db_update('node_type')
->fields(array(
'module' => 'node',
'base' => 'node_content',
))
->condition('module', 'blog')
->execute();
}
/**
* @} End of "defgroup updates-7.x-to-8.x".
* The next series of updates should start at 9000.
......
......@@ -443,11 +443,11 @@
'translate',
))
->values(array(
'nid' => '38',
'vid' => '50',
'nid' => '50',
'vid' => '70',
'type' => 'article',
'language' => 'und',
'title' => 'Node title 38',
'title' => 'Node title 50',
'uid' => '6',
'status' => '1',
'created' => '1263769200',
......@@ -459,11 +459,11 @@
'translate' => '0',
))
->values(array(
'nid' => '39',
'vid' => '55',
'nid' => '51',
'vid' => '75',
'type' => 'article',
'language' => 'ca',
'title' => 'Node title 39',
'title' => 'Node title 51',
'uid' => '6',
'status' => '1',
'created' => '1263769300',
......@@ -475,11 +475,11 @@
'translate' => '0',
))
->values(array(
'nid' => '40',
'vid' => '60',
'nid' => '52',
'vid' => '80',
'type' => 'article',
'language' => 'en',
'title' => 'Node title 40',
'title' => 'Node title 52',
'uid' => '6',
'status' => '1',
'created' => '1263769534',
......@@ -487,15 +487,15 @@
'comment' => '0',
'promote' => '0',
'sticky' => '0',
'tnid' => '40',
'tnid' => '52',
'translate' => '0',
))
->values(array(
'nid' => '41',
'vid' => '65',
'nid' => '53',
'vid' => '85',
'type' => 'article',
'language' => 'cv',
'title' => 'Node title 41',
'title' => 'Node title 53',
'uid' => '6',
'status' => '1',
'created' => '1263770064',
......@@ -503,7 +503,7 @@
'comment' => '0',
'promote' => '0',
'sticky' => '0',
'tnid' => '40',
'tnid' => '52',
'translate' => '0',
))
->execute();
......@@ -518,7 +518,7 @@
'comment_count',
))
->values(array(
'nid' => '38',
'nid' => '50',
'cid' => '0',
'last_comment_timestamp' => '1314997642',
'last_comment_name' => NULL,
......@@ -541,10 +541,10 @@
'sticky',
))
->values(array(
'nid' => '38',
'vid' => '50',
'nid' => '50',
'vid' => '70',
'uid' => '6',
'title' => 'Node title 38',
'title' => 'Node title 50',
'log' => 'Added a LANGUAGE_NOT_SPECIFIED node to comment on.',
'timestamp' => '1314997642',
'status' => '1',
......@@ -553,10 +553,10 @@
'sticky' => '0',
))
->values(array(
'nid' => '39',
'vid' => '55',
'nid' => '51',
'vid' => '75',
'uid' => '6',
'title' => 'Node title 39',
'title' => 'Node title 51',
'log' => 'Created a Catalan node.',
'timestamp' => '1263769300',
'status' => '1',
......@@ -565,10 +565,10 @@
'sticky' => '0',
))
->values(array(
'nid' => '40',
'vid' => '60',
'nid' => '52',
'vid' => '80',
'uid' => '6',
'title' => 'Node title 40',
'title' => 'Node title 52',
'log' => 'Created source translation in English.',
'timestamp' => '1263769534',
'status' => '1',
......@@ -577,10 +577,10 @@
'sticky' => '0',
))
->values(array(
'nid' => '41',
'vid' => '65',
'nid' => '53',
'vid' => '85',
'uid' => '6',
'title' => 'Node title 41',
'title' => 'Node title 53',
'log' => 'Created Chuvash translation.',
'timestamp' => '1263770064',
'status' => '1',
......@@ -607,8 +607,8 @@
'entity_type' => 'node',
'bundle' => 'article',
'deleted' => '0',
'entity_id' => '38',
'revision_id' => '50',
'entity_id' => '50',
'revision_id' => '70',
'language' => 'und',
'delta' => '0',
'body_value' => 'Node body',
......@@ -634,8 +634,8 @@
'entity_type' => 'node',
'bundle' => 'article',
'deleted' => '0',
'entity_id' => '38',
'revision_id' => '50',
'entity_id' => '50',
'revision_id' => '70',
'language' => 'und',
'delta' => '0',
'body_value' => 'Node body',
......@@ -664,7 +664,7 @@
->values(array(
'cid' => '1',
'pid' => '0',
'nid' => '38',
'nid' => '50',
'uid' => '6',
'subject' => 'First test comment',
'hostname' => '127.0.0.1',
......@@ -680,7 +680,7 @@
->values(array(
'cid' => '2',
'pid' => '0',
'nid' => '38',
'nid' => '50',
'uid' => '6',
'subject' => 'Reply to first test comment',
'hostname' => '127.0.0.1',
......
......@@ -160,12 +160,21 @@
$node_id = 0;
$revision_id = 0;
module_load_include('inc', 'node', 'node.pages');
for ($i = 0; $i < 24; $i++) {
for ($i = 0; $i < 36; $i++) {
$uid = intval($i / 8) + 3;
$user = user_load($uid);
$node = new stdClass();
$node->uid = $uid;
$node->type = $i < 12 ? 'page' : 'story';
$node->type = 'page';
if ($i < 12) {
$node->type = 'page';
}
else if ($i < 24) {
$node->type = 'story';
}
else if (module_exists('blog')) {
$node->type = 'blog';
}
$node->sticky = 0;
++$node_id;
++$revision_id;
......
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