diff --git a/1837650-142-entityreference-referencing-specific-revision-reroll-134_1.patch b/1837650-142-entityreference-referencing-specific-revision-reroll-134_1.patch index 4c6639c..cfcce23 100644 --- a/1837650-142-entityreference-referencing-specific-revision-reroll-134_1.patch +++ b/1837650-142-entityreference-referencing-specific-revision-reroll-134_1.patch @@ -68,10 +68,10 @@ index ce61018..036a1a8 100644 + } + } diff --git a/entityreference.module b/entityreference.module -index c0c9f58..597ec9c 100644 +index c0c9f58..8311383 100644 --- a/entityreference.module +++ b/entityreference.module -@@ -266,6 +266,46 @@ function entityreference_field_validate($entity_type, $entity, $field, $instance +@@ -266,6 +266,45 @@ function entityreference_field_validate($entity_type, $entity, $field, $instance * Adds the target type to the field data structure when saving. */ function entityreference_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) { @@ -95,10 +95,9 @@ index c0c9f58..597ec9c 100644 + + // If the revisions are locked, make sure they do not change. + if (!empty($field['settings']['handler_settings']['lock_revision'])) { -+ // Get the revision ID from the original item. If that is not set get it -+ // from the current item. -+ $revision_id = !empty($item['revision_id']) ? $item['revision_id'] : NULL; ++ // Get the revision ID from the original item unless set in current item. + $revision_id = !empty($original_revision_ids[$item['target_id']]) ? $original_revision_ids[$item['target_id']] : $revision_id; ++ $revision_id = !empty($item['revision_id']) ? $item['revision_id'] : $revision_id; + } + // Use the current revision if the revisions are not locked, or no + // previous revision was set. @@ -118,7 +117,7 @@ index c0c9f58..597ec9c 100644 // Invoke the behaviors. foreach (entityreference_get_behavior_handlers($field, $instance) as $handler) { $handler->presave($entity_type, $entity, $field, $instance, $langcode, $items); -@@ -719,6 +759,15 @@ function entityreference_field_property_callback(&$info, $entity_type, $field, $ +@@ -719,6 +758,15 @@ function entityreference_field_property_callback(&$info, $entity_type, $field, $ // Then apply the default. entity_metadata_field_default_property_callback($info, $entity_type, $field, $instance, $field_type); @@ -134,7 +133,7 @@ index c0c9f58..597ec9c 100644 // Invoke the behaviors to allow them to change the properties. foreach (entityreference_get_behavior_handlers($field, $instance) as $handler) { $handler->property_info_alter($info, $entity_type, $field, $instance, $field_type); -@@ -726,6 +775,52 @@ function entityreference_field_property_callback(&$info, $entity_type, $field, $ +@@ -726,6 +774,52 @@ function entityreference_field_property_callback(&$info, $entity_type, $field, $ } /** @@ -187,7 +186,7 @@ index c0c9f58..597ec9c 100644 * Implements hook_field_widget_info(). */ function entityreference_field_widget_info() { -@@ -1283,11 +1378,15 @@ function entityreference_field_formatter_prepare_view($entity_type, $entities, $ +@@ -1283,11 +1377,15 @@ function entityreference_field_formatter_prepare_view($entity_type, $entities, $ $target_type = $field_type_settings['entity_type']; $column = $field_type_settings['column']; $target_ids = array(); @@ -204,7 +203,7 @@ index c0c9f58..597ec9c 100644 $target_ids[] = $item[$column]; } } -@@ -1300,25 +1399,44 @@ function entityreference_field_formatter_prepare_view($entity_type, $entities, $ +@@ -1300,25 +1398,44 @@ function entityreference_field_formatter_prepare_view($entity_type, $entities, $ $target_entities = array(); }