When importing a new entity via Migrate, the assigned values are "overwritten" by the behaviour values, but that might not to be useful if the one wants to import the original creation date or author UID.
I'll post a patch for solving that, in the next comment. ;)
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | eck-allow-initial-changed-property-1546972-7.patch | 987 bytes | acrazyanimal |
| #1 | eck-migrate-properties-1546972-1.patch | 1.09 KB | derhasi |
Comments
Comment #1
derhasi commentedAnd there it is, a patch, that does only implement the behviour specific functions if no migrate flag is set.
The wrapper function might be used for other modules (or an hook) too.
Comment #2
fmizzell commented@derhasi, thank you for the patch. I am not sure that adding code to the behavior is the best way to handle the problem. I have not used migrate, so I do not know how it works, but would deactivating the behavior work?
I added a couple of function to the EntityType class to make that easier:
would this approach work?
Comment #3
derhasi commentedThat would not work for migrate and other modules, as the entity is often not build AND saved in one process, like in Rules or Migrate, first alle fields are populated, and after some time, the entity is saved.
Comment #4
derhasi commentedComment #5
fmizzell commentedDo you think the solution presented by @acrazyanimal here #1600838: Author and Created behaviours override previously set values would solve the problem? I think the solution in the other issue is a little bit more general than an if statement targeted to the migrate module. Let me know, otherwise I will push your path through until a better solution can be implemented.
Comment #6
acrazyanimal commentedThe patch in #1600838: Author and Created behaviours override previously set values has been committed and should resolve this issue as well. Marking as fixed.
Comment #7
derhasi commentedSorry, but that patch does not fix this issues problem, as it also occurs for the "changed" behaviour.
Comment #8
acrazyanimal commentedGotcha! Right, I had assumed that 'changed' would always be the date that it was changed and thus we didn't need to worry about this case. However, I did not consider imports/migration on entity creation. Cool I'll see what I can do.
Comment #9
acrazyanimal commentedTry this patch out.
Comment #10
fmizzell commented