Sep 19, 2014 04:51
did you get my email ?
Sep 17, 2014 17:28
Yes, contact me through my site www.2pha.com
Sep 17, 2014 17:28
Sorry, the function does need to return 'form' and you must remove the menu_get_object() from the submit function and use an alternative method to get the node. As you now have access to the node id in the submit fuction, you can use node_load()
Sep 17, 2014 17:28
did you remove the call to menu_get_object() in the submit function?
Sep 17, 2014 17:28
I have updated the answer showing how to add a hidden field to the form. This value should now be available in the submit handler. This should allow you to load the node without using the menu_get_object() function in the submit.
Sep 17, 2014 17:28
?.... I did not mean to add type=>hidden on your submit button, I mean create another form element of type=>hidden and give it a default value
Sep 17, 2014 17:28
same way as you added the submit button except '#type"=>'hidden', and 'default_value'=>node->nid
Sep 17, 2014 17:28
It would depend on where your form is being displayed. Is the form being displayed on a node page? If so, you could add a hidden form element containing the node id, then it should be available in the submit function.
Sep 17, 2014 17:28
Then I suspect your problem is with your call to menu_get_object as the current path in the ajax request is system/ajax so `menu_get_item' will not work in an ajax call. You are probably going to have to send an argument in the url that will allow you to load the appropriate node.