diff --git a/simplenews.install b/simplenews.install index 00517cc..4b7dec3 100644 --- a/simplenews.install +++ b/simplenews.install @@ -831,3 +831,18 @@ function simplenews_update_7007() { 'description' => 'Sender name for newsletter emails.', )); } + +/** + * Add the timestamp column to the {simplenews_subscription} table if missing. + */ +function simplenews_update_7008() { + if (!db_field_exists('simplenews_subscription', 'timestamp')) { + db_add_field('simplenews_subscription', 'timestamp', array( + 'description' => 'UNIX timestamp of when the user is (un)subscribed.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + )); + } +} \ No newline at end of file diff --git a/tests/simplenews.test b/tests/simplenews.test index 1211629..b4c85ac 100644 --- a/tests/simplenews.test +++ b/tests/simplenews.test @@ -1870,6 +1870,11 @@ class SimpleNewsUpgradePathTestCase extends UpgradePathTestCase { ); $this->drupalPost('admin/modules', $edit, t('Save configuration')); + // Attempt to subscribe a mail address. + $mail = 'new@example.org'; + $tid = 1; + module_load_include('module', 'simplenews'); + simplenews_subscribe_user($mail, $tid, FALSE); $this->drupalGet('admin/config/services/simplenews'); $this->assertText('Drupal 6 newsletter'); @@ -1877,6 +1882,7 @@ class SimpleNewsUpgradePathTestCase extends UpgradePathTestCase { $this->drupalGet('admin/people/simplenews'); $this->assertText('another@example.org'); + $this->assertText($mail); $this->drupalGet('admin/structure/taxonomy/newsletter');