Problem/Motivation
Current migrate destination plugin supports a "new_revisions" configuration option that creates a revision for the entity on migrate. However, it calculates the revision id from the old destination id values, and in a regular import (with update) those might be always filled in, so there's no way to force a revision to be created if you'd want a migrate process that always kept a track of the imported values.
My use case is importing (and regularly update) an entity that has a particular value I need to track changes over time.
Proposed resolution
Add a "force_revision" configuration option to always generate a revision.
Remaining tasks
Review on the proposed patch is needed to see if this is a change that would be interesting for the module and decide what direction to take.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | reroll_diff_10_14.txt | 2.7 KB | pookmish |
| #14 | 3004210-14.patch | 5.86 KB | pookmish |
Comments
Comment #2
pcambraComment #3
miro_dietikerDid you accidentally mix the names?
Comment #4
pcambraMost probably :)
Comment #6
miro_dietikerAs the key is optional, we can not expect it being present.
Will you find time to test cover it a bit?
Comment #7
pcambraYup, just wanted to ask if you'd be OK with adding something like this.
Comment #8
pcambraLet's see how's this looking.
Comment #10
pcambraHad to use a slightly different data structure for this
Comment #11
pookmish commentedThe patch in #10 worked for me using the "force_revision: true" but i had to make some extra changes to make it work correctly with node revisions. Note, i'm using migrate plus and migrate tools. I'm not sure if theres a way to incorporate this into the plugin?
Comment #12
pcambra@pookmish not sure if I understand what do you mean with incorporating changes into the plugin?
For using force_revisions, you need to set new_revisions to true, I think that's in the docs of the plugin, what else would be needed?
Comment #13
pookmish commentednot in the plugin defintinon, but in the process on the node. Without processing
revision_timestampandrevision_translation_affecteda new revision was created with a new revision ID, but it never appeared on the revisions list page for the node. Once i set the two processes i was able to see revisions on every migration update. note that i was also using the diff module.I wasn't sure if incorporating the changes to the timestamp and translation affected would be ideal. but at least providing my experience may help others.
Comment #14
pookmish commentedRerolling for latest code.
Comment #15
merilainen commentedThis is exactly what I needed and works perfectly!
Comment #16
berdirCommitted, thanks.