Download & Extend

Get rid of the admin/structure/contact/settings page

Project:Drupal core
Version:7.x-dev
Component:contact.module
Category:task
Priority:normal
Assigned:Dave Reid
Status:closed (fixed)
Issue tags:D7UX, IA, Needs Documentation

Issue Summary

We only have two settings on the Contact Settings page:
1: The hourly threshold, which we should change to a hidden variable, just like the login flood limit/window. I've created a new Drupal 7 module to expose an admin interface for the flood control variables (Flood control).
2: This variable is renamed from contact_hourly_threshold to contact_threshold_limit. We also add a hidden contact_threshold_window set to an hour so we can control the amount of time that people can send e-mails.
3: The enable contact form by default for users can be moved to admin/config/people/accounts under a new "Contact form" fieldset.

Comments

#1

Status:active» needs review
AttachmentSizeStatusTest resultOperations
570142-remove-contact-settings-D7.patch9.11 KBIdleFailed: 12767 passes, 6 fails, 1 exceptionView details

#2

Revised patch with a period at the end of the contact form checkbox. Also included before & after screenshots along with a screenshot of the flood_control interface.

AttachmentSizeStatusTest resultOperations
570142-remove-contact-settings-D7.patch9.11 KBIdleFailed: 12781 passes, 6 fails, 1 exceptionView details
570142-before.png18.01 KBIgnored: Check issue status.NoneNone
570142-after.png36.27 KBIgnored: Check issue status.NoneNone
570142-flood-control.png26.37 KBIgnored: Check issue status.NoneNone

#3

Missed one variable name change. Also included a screenshot of the contact page when flood control is limited and these variables are set:

variable_set('contact_threshold_limit', 5);
variable_set('contact_threshold_window', 300);
AttachmentSizeStatusTest resultOperations
570142-remove-contact-settings-D7.patch9.11 KBIdleFailed: 12794 passes, 6 fails, 1 exceptionView details
570142-limited.png42.96 KBIgnored: Check issue status.NoneNone

#4

Status:needs review» needs work

The last submitted patch failed testing.

#5

Status:needs work» needs review

Arg...tests won't run on my machine because of the freaking cache_update table errors. Maybe this one will pass?

AttachmentSizeStatusTest resultOperations
570142-remove-contact-settings-D7.patch9.5 KBIdleFailed: 12808 passes, 2 fails, 1 exceptionView details

#6

#7

Status:needs review» needs work

The last submitted patch failed testing.

#8

Status:needs work» needs review

Revised patch now that my testing works again and this one should pass the bot. Note again I'm fully willing to support these contact flood limit/window variables in Flood control module.

AttachmentSizeStatusTest resultOperations
570142-remove-contact-settings-D7.patch11.73 KBIdlePassed: 13315 passes, 0 fails, 0 exceptionsView details

#9

Revised patch with proper variable uninstalls.

AttachmentSizeStatusTest resultOperations
570142-remove-contact-settings-D7.patch13.12 KBIdlePassed: 13308 passes, 0 fails, 0 exceptionsView details

#10

So summary review:
1: The hourly threshold, has been changed to a hidden variable, just like the login flood limit/window. I've created a new Drupal 7 module to expose an admin interface for the flood control variables at http://drupal.org/project/flood_control.
2: This variable is renamed from contact_hourly_threshold to contact_threshold_limit for consistancy with the login flood variable names. Also added another variable contact_threshold_window (default 1 hour) so we can control the amount of time that people can send e-mails.
3: The enable contact form by default for users moved to admin/config/people/accounts under a new "Contact form" fieldset.
4: Removed variable_del('contact_form_information'); from contact_uninstall() because the variable is no longer used and it is deleted in system_update_7021().

Screenshots for the new pages and the Flood control module are in #2.

#11

Fixed 'System' in the update docs and changed it to 'Contact'.

AttachmentSizeStatusTest resultOperations
570142-remove-contact-settings-D7.patch12.22 KBIdlePassed: 13351 passes, 0 fails, 0 exceptionsView details

#12

I'm comfortable with this patch, but only when we bump the mail threshold from 3 to 5 or something. I had to bump the 3 on a number of my sites, and I don't feel like having to install a separate module for it. Sounds like a deal?

(Bojhan or someone else had a similar patch along these lines elsewhere. Might be useful to dig that up.)

#14

Revised patch with default flood limits set to five messages in one hour.

AttachmentSizeStatusTest resultOperations
570142-remove-contact-settings-D7.patch12.22 KBIdlePassed: 13349 passes, 0 fails, 0 exceptionsView details

#15

Status:needs review» fixed

Committed to CVS HEAD. Thanks!

#16

Status:fixed» needs work
Issue tags:-Needs usability review+Needs Documentation

Awesome. FYI I updated the Flood control module to account for both these new variables and the new default limit of 5. I should make a note of this in the upgrade docs.

#17

So, gone with the admin/structure/contact/settings page is the ability to configure the text that appears above the contact form. Is that somewhere else now? It looks like it's been removed entirely from contact_site_form().

If that functionality is gone, the text on admin/structure/contact directing people there should be removed.

Here's what it says now:

On the settings page, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.

#18

Sorry, meant to attach a patch. This addresses my comment #17, if the contact form text is in fact gone.

AttachmentSizeStatusTest resultOperations
570142-contact_settings_text.patch2 KBIgnored: Check issue status.NoneNone

#19

There is an existing issue to cleanup the contact_help text, because there is a lot of outdated text in there. Contact info was moved to a block-only approach because of proper input formats, etc. Users upgrading should automatically get a new block called 'Contact page help' in system_update_7021().

#20

Please followup in #599124: Cleanup contact_help()

#21

Makes sense. Thanks for the clarification.

#22

Status:needs work» fixed

I can't find where exactly this should be documented, so I'm marking this as fixed.

#23

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#24

Contact info was moved to a block-only approach because of proper input formats, etc.

Just FYI, it took me a bit of digging to find this bit of information - it would be nice if it were better documented in the upgrade guide... I couldn't find anything in there. I think I may just do it myself :)

I added a note here: http://drupal.org/node/778208#comment-3719396