Ok, as proposed, these are some changes that were required to implemented the mentioned sub-modules.
If really necessary, I can split it up, but most changes aren't that big.
Changes introduced in this patch:
- a delete permission (we might need to add an info when upgrading that the permissions need to be updated)
- the username is properly themed in the reply form and view message list
- when replying a message, the recipient list is not re-parsed but instead read from the database.
- completely reworked _privatemsg_parse_userstring(). A hook is now executed that allows other modules to lookup a string. Note that the hook is only executed until a module does return a user object. If no hooks are available or if no user object is returned from any available hook, it falls back to the existing username lookup.
- a query_args key for select is added
- autocomplete usernames aren't validated before checked (necessary to get realname autocomplete working, as these might not be valid usernames)
If you have any questions, feel free to ask. This still needs some work (hook documentation, for example) but I wanted to upload it to get some reviews.
Comment | File | Size | Author |
---|---|---|---|
#5 | privatemsg_improvements_d7_2.patch | 13.44 KB | Berdir |
#3 | privatemsg_improvements_d7.patch | 10.46 KB | Berdir |
privatemsg_improvements.patch | 11.59 KB | Berdir | |
Comments
Comment #1
litwol CreditAttribution: litwol commentedComment #2
litwol CreditAttribution: litwol commentedComment #3
BerdirRe-roll for D7.
Thanks to DBTNG, the assemble_query() changes aren't necessary and the function _privatemsg_load_thread_participants() consists only of two lines, but I left it because I think it's easier to port patches back/forward then.
Comment #4
Berdirsomething is not yet right...
Comment #5
BerdirGot it.
Two bugs in the existing code...
- the sql definition for participants used addExpression() for the uid because it was a DISTINCT first (I changed that to a distinct() call) and Expressions are added after fields, so fetchCol() passed the username to user_load_multiple(). That doesn't work :)
- After discussing this with moshe, I found out that the new #theme feature only works as I expected it for theme functions and not template files. So I reverted two theme() calls to call theme() directly.
Comment #6
litwol CreditAttribution: litwol commentedReopen if you find more bugs.
Comment #8
rickydrupal CreditAttribution: rickydrupal commentedHow can i apply the fix in d6?
I tried UnxUtils & TortoiseSVN but failed
Comment #9
BerdirSame here, this has already been fixed.
The issue is *not* about realname integration, it's just a preparation for that.
Comment #10
Berdir