Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save orakili/532ade55c3c3e3bf8d8a92d5e1aaafaa to your computer and use it in GitHub Desktop.
Save orakili/532ade55c3c3e3bf8d8a92d5e1aaafaa to your computer and use it in GitHub Desktop.
Restore primary key when saving over an existing revision
diff --git a/taxonomy_revision.module b/taxonomy_revision.module
index ea72297..4ca3018 100644
--- a/taxonomy_revision.module
+++ b/taxonomy_revision.module
@@ -315,7 +315,7 @@ function _taxonomy_revision_taxonomy_term_save_revision($term) {
// Save over an existing revision if requested.
if (isset($term->revision_id) && $term->revision_id && empty($term->revision)) {
- drupal_write_record('taxonomy_term_data_revision', $term);
+ drupal_write_record('taxonomy_term_data_revision', $term, array('revision_id'));
}
// Otherwise force a new revision to be created, and update the
// {taxonomy_term_data} table with the new revision ID.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment