2015-07-01 92 views
0

我试图将现有节点的编辑表单添加到基本页面。根据给定的nidDrupal 7 - 将节点编辑表单添加到“简单页面”

这个问题似乎简单,但我尝试导致以下错误报告:

$node = node_load(array('nid' => 83)); 
$output = drupal_get_form($node->type .'_node_form', $node); 
echo $output; 

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 175 of /home/PAE/www/paemanu/includes/entity.inc). 
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 388 of /home/PAE/www/paemanu/includes/entity.inc). 
Notice: Trying to get property of non-object in eval() (line 3 of /home/PAE/www/paemanu/modules/php/php.module(80) : eval()'d code). 
Notice: Undefined index: _node_form in drupal_retrieve_form() (line 806 of /home/PAE/www/paemanu/includes/form.inc). 
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '_node_form' not found or invalid function name in drupal_retrieve_form() (line 841 of /home/PAE/www/paemanu/includes/form.inc). 
Notice: Undefined variable: output in eval() (line 3 of /home/PAE/www/paemanu/modules/php/php.module(80) : eval()'d code). 
Notice: Undefined index: user-project in drupal_retrieve_form() (line 806 of /home/PAE/www/paemanu/includes/form.inc). 
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'user-project' not found or invalid function name in drupal_retrieve_form() (line 841 of /home/PAE/www/paemanu/includes/form.inc). 

我已经在这个问题上几个小时,任何帮助是极大的赞赏。

+1

检查这个环节出http://stackoverflow.com/questions/5344754/drupal-7-how-to-display-node-add-sometype-form-on-另一页使用第一个答案 –

回答

1

试试这个代码:

$nid = 83; 
$node = node_load($nid); 
$type = $node->type; 
module_load_include('inc', 'node', 'node.pages'); 
$form = drupal_get_form('node_edit_'.$type, $node); 
render($form); 
相关问题