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.
The "To:" line of the personal contact form is supposed to display the username of the user whose contact page you're viewing. Instead it's blank (although the code appears to be correct and it works as expected in 4.7).
Patch simply removes the "To:" field from the form since it isn't working, and the username is already displayed as the page title anyways.
Comment | File | Size | Author |
---|---|---|---|
#3 | patch_36.txt | 817 bytes | webernet |
#2 | patch_35.txt | 606 bytes | webernet |
patch_31.txt | 699 bytes | webernet |
Comments
Comment #1
webernet CreditAttribution: webernet commentedThe original patch simply gets rid of the problematic code - of course, that's not the best solution - it should be fixed instead!
The page title set in contact_user_page() works as expected.
The to line in contact_mail_user() doesn't.
Comment #2
webernet CreditAttribution: webernet commentedI think I found the issue - $account was initialised in the parent function (contact_user_page()), but not in contact_mail_user(). Consequently the output was always blank.
Patch adds a line to initialize $account in contact_mail_user().
Comment #3
webernet CreditAttribution: webernet commentedAttached is a better patch which passes $account to the function, rather than recreating it.
Comment #4
webchickPatch #3 does look cleaner, but is also an API change, so I'm not sure if it can be accepted.
chx says that it was a mistake that the function ended up not passing an argument, though... happened during the FAPI 2.0 conversion.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #6
(not verified) CreditAttribution: commented