I've just started using Drupal 7 and cannot find an answer to this question so I'm hoping for some help here. I've added custom fields to the user profile on the /admin/config/people/accounts/fields page. For example, I've defined a School field which is text type and a Specialty field which is a list text type.

I'd like logged in users to be able to update their user profile information when submitting a comment to an article. How do I customize the comment form to allow a user to update the custom user profile fields. I've looked in the form and there is an author field, however this only contains the basics like name and email, not the custom fields.

Edit: I want this to be one form submission, both adding a comment and updating user profile information. It seems the way to customize the comment form is through the method function THEMENAME_form_comment_form_alter(&$form, &$form_state), however the $form object doesn't contain the custom user account fields that I've defined.

closed as too broad by Free Radical, Bala, Mołot, Jimajamma, Letharion Jan 26 '14 at 10:37

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


The module Profiles2 will allow you to add fields through an associated profile structure and provides the familiar Drupal form format for managing fields.

  • How is that different then creating custom fields on the user accounts? I'm still not sure how I go from creating those fields to getting them included in the $form object that is passed into the comment_form_alter method. – chriskopec Apr 15 '12 at 17:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.