Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I often build communities for groups of individuals where there is already a level of trust between users. Therefore, it makes sense for these sites to have the personal contact module automatically turned on when a new user is created. This patch makes "opt out" behavior for this module possible, when enabled by the adminstrator.
Comment | File | Size | Author |
---|---|---|---|
#17 | contact_default.module | 1.05 KB | Robert Castelo |
#13 | contact.patch.txt | 1.66 KB | Zen |
#9 | opt_out_2.patch | 1.89 KB | Steve Dondley |
#6 | opt_out_1.patch | 3.06 KB | Steve Dondley |
#4 | opt_out_0.patch | 1.89 KB | Steve Dondley |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commented+1 for the idea
Comment #2
Crell CreditAttribution: Crell commentedI would probably have called it something like "Default to contactable" rather than "opt out", but this works too.
Code looks good, applies cleanly against CVS HEAD, works as advertised, and does something very very good.
+1, ready to commit.
Comment #3
Dries CreditAttribution: Dries commentedI think the description could use some work. Can't we use something; 'enable the contact form for new users' or something? Also, please don't use tabs.
Comment #4
Steve Dondley CreditAttribution: Steve Dondley commentedDon't know what's up with my text editor. I have it set to use spaces instead of tabs.
Anyway, here's a revised patch per Dries' suggestions. I also forgot to mention that this patch will not actually work until the patch at http://drupal.org/node/41351 is applied to HEAD.
Comment #5
Steve Dondley CreditAttribution: Steve Dondley commentedActually, strike that last sentence. This patch includes the change to the parameter.
Comment #6
Steve Dondley CreditAttribution: Steve Dondley commentedHere's another revision that tweaks the help text some more.
This patch also adds some advisory language (seen only when the opt out feature is turned on) to users sending an email to other users "that the sending of unsolicited, commercial e-mail to other members of this site may be illegal in some countries". Thanks to osinet over in chat for pointing this out.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedi don't think we need to advise people of things that may be illegal. writing slander is illegal too. and so on.
further, that sort of message is best ouput through drupal_set_message() not in the page body directly.
Comment #8
drewish CreditAttribution: drewish commentedI'm all for this idea, I'll take a look at the patch when I get a minute.
Comment #9
Steve Dondley CreditAttribution: Steve Dondley commentedRemoved advisory about commercial spam.
Comment #10
Crell CreditAttribution: Crell commentedWell as long as we're nitpicking text... :-)
Functionality looks good, but it would probably be clearer to say "Enable personal contact forms for new users by default" (to make it clear that we're talking about a default setting, not that no one can contact anyone without this checked). Also, the description text should then be prefixed with "If set,", or otherwise clarified.
Comment #11
Steve Dondley CreditAttribution: Steve Dondley commentedComment #12
Steve Dondley CreditAttribution: Steve Dondley commentedDoes not apply cleanly.
Comment #13
Zen CreditAttribution: Zen commentedSteve's patch re-rolled with some text fixes. Also changed the ifs to elseifs.
Thanks,
-K
Comment #14
Zen CreditAttribution: Zen commentedForgot to mention: #13 changes the default *admin* setting to 1 as opposed to #9 which was 0. The admin can opt-out as well :) #13 also initialises $edit['contact'] to avoid a PHP notice later on.
-K
Comment #15
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks guys!
Comment #16
(not verified) CreditAttribution: commentedComment #17
Robert Castelo CreditAttribution: Robert Castelo commentedHere's a module that takes care of this if you need the feature now.
Put this in a 'contact_default' directory in your modules directory.
Comment #18
sym CreditAttribution: sym commentedWas this removed? I can't see it in 4.7.3 at all now...