I get the error in below code, it is strange, why it occurred?
In hook_menu
$items['share/%'] = array(
'page callback' => 'drupal_get_form',
'page arguments' => array('ym_alter_sharing_content'),
'access callback' => 'user_is_logged_in',
'type' => MENU_CALLBACK,
);
and:
function ym_alter_sharing_content($form, $form_state) {
module_load_include('inc', 'node', 'node.pages');
$nid=arg(1);
$form = node_add('share');
//$form['field_nid']['und'][0]['value']['#value']=$nid;
//$form['#submit'][]='ym_alter_sharing_submit';
//form_load_include($form_state, 'inc', 'node', 'node.pages');
return $form;
}
but it return me:
Fatal error: Call to undefined function node_form_validate()
Where is the problem?
node_form_validate()
is defined.module_load_include('inc', 'node', 'node.pages');
hook_form_alter()
. I'm sure you know that already thoughdrupal_get_form()
as your callback. Change your callback toym_alter_sharing_content()
and returnnode_add('share');
or something like that