Hi Guys - I am having an issue, while I'm trying to override the "Edit Profile" form. I need a separate URL for edit profile of the user. For this, I have created a URL using Module's hook_menu hook. In the page callback function, i'm trying to load the form using the below code:
function edit_profile() {
global $user;
$output=drupal_render(drupal_get_form('user_profile_form'));
return $output;
}
But, it's just giving me below errors and not returning me the form. Can anyone guide me please.
Notice: Undefined index: user_profile_form in drupal_retrieve_form() (line 750 of C:\wamp\www\flexia\includes\form.inc).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'user_profile_form' was given in drupal_retrieve_form() (line 785 of C:\wamp\www\flexia\includes\form.inc).
Thanks,
Comments
pls help ^-^
Hi Guys - Can anyone please help me on this? Thanks in advance.
The problem is that the
The problem is that the user_profile_form is located in user.pages.inc.
This should work :
To better understand it, check the user.module, hook_menu().
Ex:
This works great.
This works great. You can add the profile to a page.
But i also use the profile2 module. How can i add that to a page.
I can't get it working.
This works great. You can add
Sorry, double post!
Thanks Alot
Hi Arrakis83 - Thanks alot. You are a Gem in Drupal.
Thanks,
Ravi Verma
Load entire User Object
as you pass the user object to the functions that will generate the form, make sure, that all information are loaded to the passed parameter: