Closed (fixed)
Project:
Privatemsg
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 May 2009 at 05:39 UTC
Updated:
16 Nov 2012 at 10:14 UTC
Jump to comment: Most recent file
Comments
Comment #1
naheemsays commentedNot sure how to do that - I did not think there was an artificial limit placed on the number of recipients yet?
For now you can try #398916: Remove hook_form_alter in favor of a more flexible privatemsg_new form which will allow for programmatic insertion of user names as that may be easier than writing out a list of 80 odd names, but we also need to figure out some sane manner to send messages to roles/groups without resorting to sending the messages individually - imagine a site where a person sends a message to the authenticated role...
Comment #2
igorik commentedHi nbz, I applied that patch, read all discussion for it, I clear the cache before applying, but I didn't see progress for adding more names (manually, into input), the max length or number of allowed recioents was the same as before.
so I added '#maxlength' => 5000, for input "To" in privatemsg.module and it works for me. I know that it is not the good idea to do changes in contributed module, (watching new privatemsg releases and to do this change again), but I tried to play with that patch a few times but it doesn't help to me) so this is quick and working fix for me.
thanks again
Igorik
http://www.somvprahe.sk
Comment #3
naheemsays commentedits not directly linked, but it allows you to go to "messages/new/1,2,3,4,5,6,7,...,99" to have all those prefilled as recipients - just a possible convenience.
As for setting the maxlength without editing the module, hook_form alter would be the right way as Berdir mentioned in the other issue.
Comment #4
berdirSetting the correct category, this is a new feature, not a support request.
Comment #5
andypostCurrent behaviour is wrong - by default textfield is limited by 128 so this limit actualy to 8-9 usernames.
Suppose for D7 we can make a setting for recipients limit and use ajax to replace textfield with updatable widget so it make easy integration with realname and other contrib
Comment #6
nymo commentedsubscribing, i would like to limit number of recipients vs characters.
Comment #7
fureigh commentedFor anyone stumbling across this who's unfamiliar with hook_form_alter, here's a code example for setting a new limit on characters (not recipients):
Comment #8
berdirThat comment is just plain wrong because #maxlength defaults to 128. To not hardcode it, it needs to be set to 0.
To limit the number of recipients, use privatemsg_limits.module.
Patch is for 6.x-2.x, please test.
Comment #10
berdirOk, it's a bit more complicated than that.
#maxlength must be explicitly unset in an #after_build function. This should do the trick.
Comment #11
berdirCommitted to 6.x-2.x and 7.x-2.x
Powered by Dreditor (triage sandbox) and Triage transitions
Comment #13
sokrplare commentedShould this have been committed to 7.x-1.x as well? Might prevent things like this duplicate when the next 7.x-1.x release rolls out #1822330: How to increase the Recepient field limit? (128 Chars limit).