Skip to content
Snippets Groups Projects
Commit 538cfe91 authored by Angie Byron's avatar Angie Byron
Browse files

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

parent f1804497
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment