Index: modules/contact/contact.install =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.install,v retrieving revision 1.16 diff -u -p -r1.16 contact.install --- modules/contact/contact.install 29 Sep 2009 15:13:55 -0000 1.16 +++ modules/contact/contact.install 6 Oct 2009 20:55:41 -0000 @@ -7,6 +7,21 @@ */ /** + * Implement hook_install(). + */ +function contact_install() { + // Insert a default contact category. + db_insert('contact') + ->fields(array( + 'category' => 'Default', + 'recipients' => variable_get('site_mail', ini_get('sendmail_from')), + 'selected' => 1, + 'reply' => '', + )) + ->execute(); +} + +/** * Implement hook_uninstall(). */ function contact_uninstall() { Index: modules/contact/contact.test =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.test,v retrieving revision 1.31 diff -u -p -r1.31 contact.test --- modules/contact/contact.test 26 Sep 2009 00:13:19 -0000 1.31 +++ modules/contact/contact.test 6 Oct 2009 20:55:41 -0000 @@ -24,7 +24,7 @@ class ContactSitewideTestCase extends Dr // Create and login administrative user. $admin_user = $this->drupalCreateUser(array('access site-wide contact form', 'administer site-wide contact form', 'administer permissions', 'administer users')); $this->drupalLogin($admin_user); - + $flood_limit = 3; variable_set('contact_threshold_limit', $flood_limit); variable_set('contact_threshold_window', 600); @@ -173,7 +173,7 @@ class ContactSitewideTestCase extends Dr // Test the auto-reply for category 'foo'. $email = $this->randomName(32) . '@example.com'; $subject = $this->randomString(64); - $this->submitContact($this->randomName(16), $email, $subject, 1, $this->randomString(128)); + $this->submitContact($this->randomName(16), $email, $subject, 2, $this->randomString(128)); // We are testing the auto-reply, so there should be one e-mail going to the sender. $captured_emails = $this->drupalGetMails(array('id' => 'contact_page_autoreply', 'to' => $email, 'from' => 'foo@example.com')); @@ -182,7 +182,7 @@ class ContactSitewideTestCase extends Dr // Test the auto-reply for category 'bar'. $email = $this->randomName(32) . '@example.com'; - $this->submitContact($this->randomName(16), $email, $this->randomString(64), 2, $this->randomString(128)); + $this->submitContact($this->randomName(16), $email, $this->randomString(64), 3, $this->randomString(128)); // Auto-reply for category 'bar' should result in one auto-reply e-mail to the sender. $captured_emails = $this->drupalGetMails(array('id' => 'contact_page_autoreply', 'to' => $email, 'from' => 'bar@example.com')); @@ -191,7 +191,7 @@ class ContactSitewideTestCase extends Dr // Verify that no auto-reply is sent when the auto-reply field is left blank. $email = $this->randomName(32) . '@example.com'; - $this->submitContact($this->randomName(16), $email, $this->randomString(64), 3, $this->randomString(128)); + $this->submitContact($this->randomName(16), $email, $this->randomString(64), 4, $this->randomString(128)); $captured_emails = $this->drupalGetMails(array('id' => 'contact_page_autoreply', 'to' => $email, 'from' => 'no_autoreply@example.com')); $this->assertEqual(count($captured_emails), 0, t('No auto-reply e-mail was sent to the sender for category "no-autoreply".'), t('Contact')); } @@ -319,7 +319,7 @@ class ContactPersonalTestCase extends Dr function testPersonalContact() { $admin_user = $this->drupalCreateUser(array('administer site-wide contact form', 'administer users')); $this->drupalLogin($admin_user); - + $flood_limit = 3; variable_set('contact_threshold_limit', $flood_limit);