Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.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.

share|improve this answer
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.