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'm mainly wondering if this is possible for me to alter or override on my part, but I also think this is how it should be by deafult. I don't see what purpose the comma serves when I'm not allowing more than 1 recipient.
Comments
Comment #1
BerdirThe problem is that the autocomplete suggestion knows nothing about that limitation because that limitation comes from a separate module.
Not sure how to properly fix that.
Comment #2
TwiiK CreditAttribution: TwiiK commentedWouldn't something like this work?
replace:
with:
It seems to work for me.
I actually don't know how to write a patch and I see that you asked me for one in my other issue. It's high time I learn to do so so the next time I'll try to have a patch instead. :)
Comment #3
BerdirCreating patches with git is easy, every project has a git instructions local task with specific instructions, see for example http://drupal.org/node/3279/git-instructions/master/nonmaintainer
About the code. Yes, we want something like that. The problem is, I'd like to avoid putting privatemsg_filter specific code into privatemsg.module, we really want to keep them separate.
So what I'd suggest is something like this:
- Add a drupal_alter('privatemsg_autocomplete_suggestions', $suggestions) below that code.
- Document that new hook (hook_privatemsg_autocomplete_suggestions_alter($suggestions) in privatemsg.api.php
- Then, implement that hook in privatemsg_filter.module and remove the trailing ", ". Additionally, you can also add code to verify that there is only the limited amount of suggestions. Example. Even if we stop adding the trailing ", ", People can still add it manually and type something like "userA, us" and Privatemsg will happily suggest another user. privatemsg_limits should only show the last X users in that suggestion list so that when you have configured it to a single recipient, it should replace the existing one.
This might look unecessary complicated at first, but this hook will allow other sites to move their autocomplete customizations into that hook, for example when they are showing a profile image in the autocomplete.
Comment #4
ptmkenny CreditAttribution: ptmkenny commentedComment #5
oadaeh CreditAttribution: oadaeh as a volunteer commentedThis issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-1.x branch (bug fixes only) or the 7.x-2.x branch.
Thank you.