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.
Hi
it would be great to have an option for admin to set max number of recipients. Current situation is not ideal, I have to add
'#maxlength' => 555,
into $form['privatemsg']['recipient'] , when I need to raise it.
thanks
Igor
Comment | File | Size | Author |
---|---|---|---|
#15 | privatemsg_1.patch | 1.82 KB | walker2238 |
#5 | privatemsg.patch | 1.47 KB | walker2238 |
Comments
Comment #1
walker2238 CreditAttribution: walker2238 commentedAdding max length isn't really the way to go. Try this...
Create a module and add
Comment #2
litwol CreditAttribution: litwol commented@walker2238 if its such an easy change, please submit a patch to be included in core of pmsg :).
Settings in admin section would be necessary.
Comment #3
walker2238 CreditAttribution: walker2238 commentedOkay, but I never did say it was easy though, or right for that matter. :) But it works for my needs.
I'll give it a go.
Comment #4
litwol CreditAttribution: litwol commentedSorry i didnt mean to belittle the efforts, i only wanted to say: Its a good feature, you seem to know how to do it already, lets get it in core :).
Cheers mate and thx for help.
Comment #5
walker2238 CreditAttribution: walker2238 commentedNo worries. I've gotten a lot of support on here so it is only fair. I was just joking with you. I'm glad to help where I can. Here's a patch. Let me know if theres anything missing. Or anything that could be added.
Opps... As you can see this is my first attempt at applying a patch.
Comment #6
litwol CreditAttribution: litwol commentedGood start.
This patch is missing one critical adition: Add a checkbox to enable/disable the max recipients feature. mac recipient should not even be checked if the feature is disabled in admin.
Comment #7
litwol CreditAttribution: litwol commentedComment #8
walker2238 CreditAttribution: walker2238 commentedTo be honest I don't personally like the idea of a checkbox. what if we just use 0 in the textfield to turn it of. And have that as default?
Comment #9
litwol CreditAttribution: litwol commentedSetting max recipients to 0 to disable it would be considered to be a "magic" behavior which is a big no-no. we need things to be explicit and i think checkbox accomplishes that.
Lets brainstorm more ideas of checkbox is not good.
Comment #10
walker2238 CreditAttribution: walker2238 commentedOh okay, I didn't know that.
I had it set up so that that maxlength could be up to 999... which is a lot of recipients, but not really a good way to handle things. I guess your right then. Checkbox seems the most logical unless you make a sub module.
Comment #11
litwol CreditAttribution: litwol commentedTo make sure we are on the same page: we need both check box to enable/disable the feature and a text field to specify how many recipients: 0-999 ?
Comment #12
walker2238 CreditAttribution: walker2238 commentedYup,
I might end up kicking myself later but what about permissions? The main reason is for admin type users who wish to send mass PM to all site users. (Not sure if this exists for privatemsg).
Comment #13
litwol CreditAttribution: litwol commentedThat is true. However we've not figured out a way to mass message to all users or to specific groups so we should not worry about it just yet. This is a small enough patch to change later on.
So add that checkbox so others can test it :)
Comment #14
BerdirImho, that would make sense as part of the limits/quota module... #69856: Message limits. Feel free to update that and/or merge it with http://drupal.org/project/privatemsg_limits as I don't have time right now...
Comment #15
walker2238 CreditAttribution: walker2238 commentedHere. I added the checkbox. I didn't test it but pretty sure it works.
I haven't looked at either of those sub modules much. Actually didn't even know privatemsg_limits existed. I'll leave it up to you guys to decide where to put it.
Comment #16
BerdirWell, I can't decide this, but imho, it does belong into either of those modules, because all other limitation settings are there too.
Your code needs work anyway, because the intendation is off.
Comment #17
Berdir#69856: Message limits now also allows to limit the number of recipients.