Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Once #2423435: Add CckField Plugin type to migrate_drupal lands we should use the new API for our field types in core that need extra processing.
Proposed resolution
Implement the new plugin type.
Remaining tasks
Write patch
User interface changes
n/a
API changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#30 | interdiff-2448501-28-30.txt | 1.35 KB | phenaproxima |
#30 | 2448501-30.patch | 9.88 KB | phenaproxima |
#28 | interdiff-2448501-27-28.txt | 494 bytes | phenaproxima |
#28 | 2448501-28.patch | 8.77 KB | phenaproxima |
#27 | interdiff-2448501-14-41.txt | 2.65 KB | phenaproxima |
Comments
Comment #1
ultimikeWhile working with a sandbox module to test cckfield plugins, benjy discovered a bug in the MigrationStorage class. I've attached a fix for it here as a start for this task.
-mike
Comment #2
ultimikeI started looking at this today and need some help with a plan of attack. I figure it can mostly be based on Benjy's iFrame sandbox module, so that's what I'm starting with.
For the
class LinkField extends CckFieldPluginBase
what do we actually need? Should the formatter and other settings maps remain in the migrate.migration.d6_field_formatter_settings.yml or should those be moved into the class?The processors seems straight-forward - I'm not sure anything needs to be changed in CckLink.
I'm happy to do the work on this one, and it will be a learning exercise for me, so I'm looking forward to it. Just need a little direction.
Thanks,
-mike
Comment #3
ultimikeIgnore my last comment - I think I'm making some good progress...
-mike
Comment #4
ultimikeOk - let's give this a shot. Patch attached.
-mike
Comment #6
ultimikeOk - let's give this another shot. This time with more unserializing.
-mike
Comment #7
ultimikeUpdate status.
Comment #8
benjy CreditAttribution: benjy at CodeDrop commentedHow about a fail patch with the change in MigrationStorage not applied? Do we have coverage for that now?
Comment #9
benjy CreditAttribution: benjy at CodeDrop commentedThis is the same as the base class implementation, so lets remove it.
The processFieldWidget() in the parent uses getFieldWidgetMap() and the default implementation for getFieldWidgetMap() is all we need.
Lets remove this as well.
Comment #10
ultimikeUpdated patch attached. Also, and interdiff as well as a "fail" patch for the MigrationStorage change. Some notes:
-mike
Comment #11
ultimikeComment #13
benjy CreditAttribution: benjy at CodeDrop commentedYes this much better, glad I reviewed again. So simple for new field types.
Super tiny nitpick. More than 80chars.
Comment #14
ultimikeWithout coding standards, we have anarchy. Super tiny nitpick fixed.
-mike
Comment #15
benjy CreditAttribution: benjy at CodeDrop commentedGreat!
Comment #18
ultimikeMoving back to RTBC after testbot failure.
-mike
Comment #23
benjy CreditAttribution: benjy at CodeDrop commentedBack to RTBC
Comment #24
alexpottGiven what strpos returns i.e. false or the position I think at least a comment is needed here. Also why doesn't
getDerivativeId()
work? And is it indicative of a bigger problem?Comment #25
benjy CreditAttribution: benjy at CodeDrop commentedThe reason is because the source plugin doesn't change its id when we're using the LoadEntity to dynamically create migrations such as cck_field_values:page etc.
Therefore we need to check the migration entity id.
Comment #26
benjy CreditAttribution: benjy at CodeDrop commentedBack to RTBC.
Comment #27
phenaproximaThis updates the patch in #14 by removing the call to
\Drupal::service()
inMigrationStorage::getCckPluginManager()
. Entity handlers can use dependency injection, so I didn't see any reason to use \Drupal in there.Comment #28
phenaproximaFixed incorrect class name in MigrationStorage::__construct()'s doc comment. And the wrong comment number in the patch and interdiff file names (I must be improperly caffeinated).
Comment #29
benjy CreditAttribution: benjy at CodeDrop commentedThat's fine by me, but if we're doing that lets remove the getCckPluginManager() method altogether.
Comment #30
phenaproximaGot rid of getCckPluginManager() and a line of extra white space.
Comment #31
benjy CreditAttribution: benjy at CodeDrop commentedThanks!
Comment #32
alexpottMigrate is not frozen in beta. Committed c689008 and pushed to 8.0.x. Thanks!
Comment #35
phenaproximaComment #36
phenaproximaAdded another follow-up issue.