Last active
September 7, 2016 23:25
-
-
Save orakili/532ade55c3c3e3bf8d8a92d5e1aaafaa to your computer and use it in GitHub Desktop.
Restore primary key when saving over an existing revision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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