diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-17 00:49:18 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-17 00:49:18 +0000 |
commit | 538cfe9150623d4d522221f252fad2daac52c35b (patch) | |
tree | 17d75b7007b4c16445b7f392ac8ce5be6e7d826f /modules/simpletest | |
parent | f180449767d54b14d024732f5ec1dd659b0b4a8d (diff) | |
download | brdo-538cfe9150623d4d522221f252fad2daac52c35b.tar.gz brdo-538cfe9150623d4d522221f252fad2daac52c35b.tar.bz2 |
#451212 by yched: Make field_test_entity_save() consistent with node_save().
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/field_test.module | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/simpletest/tests/field_test.module b/modules/simpletest/tests/field_test.module index 79b15e28b..961b62f4c 100644 --- a/modules/simpletest/tests/field_test.module +++ b/modules/simpletest/tests/field_test.module @@ -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; |