Closed (duplicate)
Project:
Drupal core
Version:
x.y.z
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2006 at 13:41 UTC
Updated:
7 Sep 2006 at 13:50 UTC
Description from from http://lists.drupal.org/archives/development/2006-09/msg00166.html
I was trying to update a node using FAPI2, but it completely failed.
First, I found out that I must cast the node into an array:
$node = (array) node_load($nid);
$values['title'] = $question['q_desc'];
$values['body'] = theme('demexp_question_body', $question);
// $values['changed'] = time();
drupal_execute('demexp_question_node_form', $values, $node);
but drupal_execute fails.
I get: "This content has been modified by another user, changes cannot be
saved." which comes from here:
if (isset($node->nid) && (node_last_changed($node->nid) >
$_POST['changed'])) {
form_set_error('changed', t('This content has been modified by another
user, changes cannot be saved.'));
}
now, with the FAPI push method, $_POST is not set, so the check above always fail.
Comments
Comment #1
heine commentedduplicate of http://drupal.org/node/80271