Closed (duplicate)
Project:
Drupal core
Version:
8.3.x-dev
Component:
migration system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2016 at 14:37 UTC
Updated:
18 Nov 2019 at 23:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bendev commentedComment #4
bendev commentedUpdated patch
Comment #5
bendev commentedComment #7
bendev commentedsorry some difficulties to create the file. Will try this one
Comment #8
mpdonadioSending this to the migration system; they will be able to evaluate this better. I do know people have been using migrations with simple field mapping, though, and not full plugins. I'm happy with it living in the Drupal\datetime_range namespace, though, if we want to add this.
Few small comments. But this would be Needs Work for test coverage.
No need for a @file declaration for something that contains a single class.
Don't need to mention D8 here. May want to wordsmith this to match the other process plugins a little closer.
I am not 100% sure if we allow camel case in core yet (there is an issue, but I can't find it). But, if we do, then the first character should be lower case.
Can use [] syntax here; it's new code. Also, the final element should have a tailing comma.
Comment #9
bendev commentedupdate of the patch for the comments in #8
Comment #10
meanderix commentedIn my D7 migration, this line fails:
list($start_date, $end_date) = $value;The
$valuevariable has non-numerical indices ('value' and 'value2'), which does not work with list assignments.Comment #11
jofitzSetting to Needs Review to test the patch in #9.
Comment #13
jofitzAddressing comments in #8 (re-write of #9).
Comment #14
jofitzAdded Unit test.
Comment #17
jofitzCorrected test class name.
Comment #19
heddnI don't think this is necessary. Closing as duplicate to #2820490: FormatDate process plugin
Comment #20
windm commented@heddn:
When I get that right, the #2820490: FormatDate process plugin is meant for formatting non-drupal sources for importing/migrating (CSV and so on), while I expected this patch to fix problems migrating datetime_range fields from older drupal versions to d8...
So is it really a duplicate ?
My specific challenge is to migrate a d6 site with CCK datetime fields (containing from-to-ranges) to d8 - so does the #2820490: FormatDate process plugin help for this? Or should I try to use this patch (#17)?
Thank you!
Comment #21
heddnRe #20: See https://www.mtech-llc.com/blog/gerardo-hernandez/migrating-date-ranges-c... on how to migrate date range fields using CSV. The idea would be very similar when pulling from D6/D7.
The idea isn't that something doesn't need to be one for date_range, its that an additional process plugin isn't necessary.
Comment #22
wim leersFor automatically migrating D7
datefields with thetodatesetting enabled: they result in data loss when usingmigrate_drupaltoday. #3095237: Migrate Drupal 7 date field "todate" value fixes that.