Commit cef1ea5f authored by fago's avatar fago

Issue #1921894 by sonictruth, Alexander Allen: Enable...

Issue #1921894 by sonictruth, Alexander Allen: Enable entity_metadata_form_user() to show the registration form if an anonymous users is passed.
parent 24965761
......@@ -972,10 +972,17 @@ function entity_metadata_form_comment($comment) {
* Callback to get the form of a user account.
function entity_metadata_form_user($account) {
// Pre-populate the form-state with the right form include.
// If $account->uid is set then we want a user edit form.
// Otherwise we want the user register form.
if (isset($account->uid)) {
$form_id = 'user_profile_form';
form_load_include($form_state, 'inc', 'user', 'user.pages');
else {
$form_id = 'user_register_form';
$form_state['build_info']['args'] = array($account);
form_load_include($form_state, 'inc', 'user', 'user.pages');
return drupal_build_form('user_profile_form', $form_state);
return drupal_build_form($form_id, $form_state);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment