Commit a8894ad5 authored by JasonMcE's avatar JasonMcE Committed by Ra Mänd
Browse files

Issue #3080957 by jasonmce: Update #7009 failed: Column 'revision_id' cannot be null

parent fb1ba149
......@@ -488,19 +488,21 @@ function field_collection_update_7009(&$sandbox) {
->condition('delta', $row_to_replace->delta)
->condition('language', $row_to_replace->language)
->execute();
}
if ($field_collection_item_current_revision == $field_collection_duplicated_revision_id) {
_field_collection_update_7009_update_data($new_revision_id, $field_collection_duplicated_revision_id);
if ($field_collection_item_current_revision == $field_collection_duplicated_revision_id) {
_field_collection_update_7009_update_data($new_revision_id, $field_collection_duplicated_revision_id);
// Update the current field collection item data in its host.
db_update("field_data_{$sandbox['field_name']}")
->fields(array('revision_id' => $new_revision))
->condition('revision_id', $old_revision)
->condition('entity_type', $row_to_replace->entity_type)
->execute();
// Update the current field collection item data in its host.
db_update("field_data_{$sandbox['field_name']}")
->fields(array('revision_id' => $new_revision_id))
->condition('revision_id', $field_collection_duplicated_revision_id)
->condition('entity_type', $row_to_replace->entity_type)
->execute();
}
}
foreach ($modern_revisions as $each_modern_revision) {
$new_revision_id = _field_collection_update_7009_new_revision($field_collection_item_id, $each_modern_revision, $sandbox['inner_fields'], $sandbox['field_name']);
......@@ -523,12 +525,12 @@ function field_collection_update_7009(&$sandbox) {
->execute();
if ($field_collection_item_current_revision == $each_modern_revision->{"{$sandbox['field_name']}_revision_id"}) {
_field_collection_update_7009_update_data($new_revision_id, $each_modern_revision->{"{$sandbox['field_name']}_revision_id"});
_field_collection_update_7009_update_data($new_revision_id, $field_collection_item_current_revision);
// Update the current field collection item data in its host.
db_update("field_data_{$sandbox['field_name']}")
->fields(array('revision_id' => $new_revision))
->condition('revision_id', $old_revision)
->fields(array('revision_id' => $new_revision_id))
->condition('revision_id', $field_collection_item_current_revision)
->condition('entity_type', $each_modern_revision->entity_type)
->execute();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment