Saving the node
Posted July 19th, 2008 by ekes
Once all the data is in the node object it's just a case of saving it and Drupal does most of the work. Some modules may require extra hooks calling before hand to make sure that extra processing is done. In this case the save just consisted of:-
function _x_node_save(&$node) {
if (trim($node->title) == '') {
$node->title = 'Title missing';
}
if (count($node->field_embedded_video)) {
video_cck_field('submit', $node, $field, $items, FALSE, FALSE);
}
module_invoke('nabuur_location', 'nodeapi', $node, 'submit');
node_object_prepare($node);
node_save($node);
_x_node_record($node);
}
if (trim($node->title) == '') {
$node->title = 'Title missing';
}
if (count($node->field_embedded_video)) {
video_cck_field('submit', $node, $field, $items, FALSE, FALSE);
}
module_invoke('nabuur_location', 'nodeapi', $node, 'submit');
node_object_prepare($node);
node_save($node);
_x_node_record($node);
}
The job does not finish here however...