#451212 by yched: Make field_test_entity_save() consistent with node_save().

merge-requests/26/head
Angie Byron 2009-05-17 00:49:18 +00:00
parent f180449767
commit 538cfe9150
1 changed files with 5 additions and 5 deletions

View File

@ -188,13 +188,13 @@ function field_test_entity_load($ftid, $ftvid = NULL) {
function field_test_entity_save(&$entity) {
field_attach_presave('test_entity', $entity);
$entity->is_new = FALSE;
if (empty($entity->ftid)) {
// Insert a new test_entity.
$entity->is_new = TRUE;
if (!isset($entity->is_new)) {
$entity->is_new = empty($entity->ftid);
}
elseif (!empty($entity->revision)) {
if (!$entity->is_new && !empty($entity->revision)) {
$entity->old_ftvid = $entity->ftvid;
unset($entity->ftvid);
}
$update_entity = TRUE;