diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-07 05:20:08 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-07 05:20:08 +0000 |
commit | c02fd214b5f339f168e9ced4a1fc38b354a0d119 (patch) | |
tree | 89401642909e568ae65cddfd3efbf933b003919e /modules/taxonomy | |
parent | 8fddf2cd48001af736e5951fb7d4e927d56dc4c2 (diff) | |
download | brdo-c02fd214b5f339f168e9ced4a1fc38b354a0d119.tar.gz brdo-c02fd214b5f339f168e9ced4a1fc38b354a0d119.tar.bz2 |
#985292 by ngmaloney, scor, bfroehle: Fixed Nodes published before 1970 won't insert in taxonomy index
Diffstat (limited to 'modules/taxonomy')
-rw-r--r-- | modules/taxonomy/taxonomy.install | 16 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.test | 37 |
2 files changed, 51 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.install b/modules/taxonomy/taxonomy.install index 4b5663ffd..15103ae48 100644 --- a/modules/taxonomy/taxonomy.install +++ b/modules/taxonomy/taxonomy.install @@ -196,7 +196,6 @@ function taxonomy_schema() { 'created' => array( 'description' => 'The Unix timestamp when the node was created.', 'type' => 'int', - 'unsigned' => TRUE, 'not null' => TRUE, 'default'=> 0, ), @@ -548,7 +547,7 @@ function taxonomy_update_7005(&$sandbox) { // in this array but a term_node relationship exists mapping a // term in voc id to node of that type, the relationship is // assigned to the taxonomymyextra field which allows terms of all - // vocabularies. + // vocabularies. // - cursor[values], cursor[deltas]: The contents of $values and // $deltas at the end of the previous call to this function. These // need to be preserved across calls because a single batch of @@ -806,3 +805,16 @@ function taxonomy_update_7009() { )); } +/** + * Change {taxonomy_index}.created to support signed int. +*/ +function taxonomy_update_7010() { + db_change_field('taxonomy_index', 'created', 'created', array( + 'description' => 'The Unix timestamp when the node was created.', + 'type' => 'int', + 'unsigned' => FALSE, + 'not null' => TRUE, + 'default'=> 0, + )); +} + diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index b31f7898b..0664c523a 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -380,6 +380,43 @@ class TaxonomyTermUnitTest extends TaxonomyWebTestCase { } /** + * Test for legacy node bug. + */ +class TaxonomyLegacyTestCase extends TaxonomyWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Test for legacy node bug.', + 'description' => 'Posts an article with a taxonomy term and a date prior to 1970.', + 'group' => 'Taxonomy', + ); + } + + function setUp() { + parent::setUp('taxonomy'); + $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'administer nodes', 'bypass node access')); + $this->drupalLogin($this->admin_user); + } + + /** + * Test taxonomy functionality with nodes prior to 1970. + */ + function testTaxonomyLegacyNode() { + // Posts an article with a taxonomy term and a date prior to 1970. + $langcode = LANGUAGE_NONE; + $edit = array(); + $edit['title'] = $this->randomName(); + $edit['date'] = '1969-01-01 00:00:00 -0500'; + $edit["body[$langcode][0][value]"] = $this->randomName(); + $edit["field_tags[$langcode]"] = $this->randomName(); + $this->drupalPost('node/add/article', $edit, t('Save')); + // Checks that the node has been saved. + $node = $this->drupalGetNodeByTitle($edit['title']); + $this->assertEqual($node->created, strtotime($edit['date']), t('Legacy node was saved with the right date.')); + } +} + +/** * Tests for taxonomy term functions. */ class TaxonomyTermTestCase extends TaxonomyWebTestCase { |