@@ -261,8 +261,16 @@ function file_field_update($entity_type, $entity, $field, $instance, $langcode,
|
||||
$current_fids[] = $item['fid'];
|
||||
}
|
||||
|
||||
// Compare the original field values with the ones that are being saved.
|
||||
$original = $entity->original;
|
||||
// Compare the original field values with the ones that are being saved. Use
|
||||
// $entity->original to check this when possible, but if it isn't available,
|
||||
// create a bare-bones entity and load its previous values instead.
|
||||
if (isset($entity->original)) {
|
||||
$original = $entity->original;
|
||||
}
|
||||
else {
|
||||
$original = entity_create_stub_entity($entity_type, array($id, $vid, $bundle));
|
||||
field_attach_load($entity_type, array($id => $original), FIELD_LOAD_CURRENT, array('field_id' => $field['id']));
|
||||
}
|
||||
$original_fids = array();
|
||||
if (!empty($original->{$field['field_name']}[$langcode])) {
|
||||
foreach ($original->{$field['field_name']}[$langcode] as $original_item) {
|
||||
|
@@ -6,8 +6,8 @@ core = 7.x
|
||||
dependencies[] = field
|
||||
files[] = tests/file.test
|
||||
|
||||
; Information added by drupal.org packaging script on 2013-03-07
|
||||
version = "7.21"
|
||||
; Information added by drupal.org packaging script on 2013-04-03
|
||||
version = "7.22"
|
||||
project = "drupal"
|
||||
datestamp = "1362616996"
|
||||
datestamp = "1365027012"
|
||||
|
||||
|
@@ -5,8 +5,8 @@ version = VERSION
|
||||
core = 7.x
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by drupal.org packaging script on 2013-03-07
|
||||
version = "7.21"
|
||||
; Information added by drupal.org packaging script on 2013-04-03
|
||||
version = "7.22"
|
||||
project = "drupal"
|
||||
datestamp = "1362616996"
|
||||
datestamp = "1365027012"
|
||||
|
||||
|
Reference in New Issue
Block a user