Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
migration system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Dec 2016 at 17:44 UTC
Updated:
23 Sep 2017 at 15:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
heddnComment #4
mikeryanWaiting for the cckfield rename to get committed.
Comment #5
jofitzNow that #2683435: CCK does not exist in Drupal 7, rename Migrate's cckfield plugins to field plugins is set to "Patch (to be ported)" does that mean we can un-postpone this? If so, what is the best way to approach this? I suspect one big patch could become unwieldy so suggest a separate ticket for each field type. Thoughts?
Comment #6
quietone commented@Jo Fitzgerald, good questions. I have the same ones.
But nothing like jumping in with both feet. Here is a patch that should have all the remaining changes.
Comment #8
quietone commentedRetesting with 8.4.x
Comment #9
jofitzI'll start by fixing a couple of minor coding standards errors before addressing the test fails.
Comment #10
jofitzRemoved assertions in MigrateCckFieldPluginManagerTest about "cckfields" that no longer exist (because they have been converted to "fields") leaving only assertions about fields provided by the migrate_cckfield_plugin_manager_test module.
Comment #11
quietone commented@Jo Fitzgerald, thanks. And let's put those tests into MigrateFieldPluginManagerTest, as well as add tests for link. Found a usage of a cck plugin in FieldFileTest, changed it so d6_file.
Also, discovered that MigrateFieldPluginManagerTest loads the file module but then doesn't test the file module plugins, it tests file from it's test module. It could use a little tidy up, which is outside the scope of this issue.
Comment #12
quietone commentedThis now contains all the remaining conversions. I understand that I started a patch without getting an answer to Jo Fitzgerald's question (#5) about breaking this into smaller pieces. Its just that my curiosity got the better of me and I wanted to see just how big the patch would be.
So, what is the next step? Should this be divided up? If so, how?
Comment #13
heddnI've looked through the code and don't see any outstanding things missed from converting yml files. Shall we bump this to RTBC? Tests still exist for BC layer. Is there anything else we should be checking?
Comment #15
tstoecklerIn D6 it actually was called CCK not "Field", right? Even for Filefield.
Comment #16
quietone commentedYes, D6 used Cck terminolgy and D7 (and onward) uses fields.
Comment #17
tstoecklerOK, so why are the D6 plugins being renamed in this patch? Sorry if I'm missing something.
Comment #18
quietone commentedThe MigrateCckField plugin started out just doing the D6 field plugins. But now it is used both D6 Cck and D7 Fields. It is equally odd to use a MigrateCckField plugin for D7 fields. And then there is 'text', which is for used for both D6 and D7. What name makes sense?
Since Cck is a term from contrib in D6 and fields is in core since D7, making them all Fields was the way to go.
Comment #19
heddnRe #17, does #18 make sense? The previous patch to rename the plugins was already committed in #2683435: CCK does not exist in Drupal 7, rename Migrate's cckfield plugins to field plugins. This just is updating all the yml files. When we had both combined into a single patch, we were creeping up north of 100k, so this was broken out.
Comment #20
mikeryanAnother way to look at it - for both D6 and D7, the things being migrated are called fields. "CCK" is just the name of the D6 module (and just the human-readable name at that - the actual module machine name is "content").
Comment #21
mikeryanI think #17 is answered - restoring RTBC.
Modified the title since we're not just touching .yml files here.
Comment #22
tstoecklerSorry for not following up, totally forgot. Yeah, if this is an explicit decision that the Migrate maintainers are on board with then I don't want to hold this up.
Comment #23
heddnReviewed this with Vasi today and the
This is a problem. We cannot rename. And this is also a problem in HEAD for LinkField. It no longer exists in
Drupal\link\Plugin\migrate\cckfield;Comment #24
mikeryanTo clarify (from my understanding) - we've renamed field plugin classes (as opposed to making copies), so if anyone has extended their own field plugins from those classes, they'll break. The "won't fix" arguments are:
Comment #25
heddnI think the interdiff seems a little odd.
Comment #26
heddnHopefully this is a little better. I think I dropped a few things in #25.
Comment #27
heddnAnd now some tests.
Comment #28
quietone commentedWhy is this adding in a cckfield plugin?
Comment #30
vasi commented@quietone: A previous issue renamed cckfield/LinkField to field/LinkField—but this breaks BC if anybody extends LinkField. Rather than revert the previous issue, we're trying to fix it here by re-adding a cckfield/LinkField.
Comment #31
quietone commented@vasi, thanks. Just got myself all confused for a while there.
So, building on the work of heddn, this patch uses the changes made for the text cckfield/field tests as a model for all the other cckfield/field pairs of plugins. There should be a deprecation notice in all the cckfield classes.
There are two known failing tests. /cckfield/d7/LinkCckFieldTest.php and /field/d7/LinkFieldTest.php. They need the constants defined in system.module. What is the proper way to do that?
And lastly, expect copy/paste errors. This got a bit tedious.
Comment #33
ohthehugemanatee commentedI can't figure out why those system.module constants aren't available. I tried changing it to a kernel test, and even explicitly adding "system" to the modules property. The other core tests that use these constants, extend WebTestBase and BrowserTestBase, which is total overkill for this.
I read through the changes and they LOOK good to me. But this is a huge patch. I would trust a machine much more than my own eyes. I know I would have committed after each step, so I could see the diffs for "moved file X" and "modified file X" separately.... @quietone did you do something like that locally? Or is this flat diff basically the only representation we have to work with?
Comment #34
quietone commentedNo, sorry. I did this in one go. :-( However, in the interest of getting this done and some learning on my part let's start again.
The first thing is to make a new patch for #27. Why? Because '
diff 2833206-27.patch 2833206-27.patchproduces 101 lines of output under "diff -u b/core/modules/file/src/Plugin/migrate/process/d6/FieldFile.php b/core/modules/file/src/Plugin/migrate/process/d6/CckFile.php'. And is just confusing. Making a new patch with '-M' to fix that. Should have the same errors as #27.Comment #36
quietone commentedNow fix the errors. Just some missing lines in the data provider.
Comment #37
quietone commentedThere are cckfield/field plugins in file, link, taxonomy and text. The test for text are already complete, and passing tests. That leaves file, link and taxonomy.
This patch add tests for the cckfield and field plugins in the file module.
Comment #38
quietone commentedNow add tests for cckfield and field plugins in the taxonomy module and fix coding standard errors found in testing.
Comment #40
quietone commentedSigh, various copy/paste errors I missed because I didn't run some tests.
Comment #41
quietone commentedNext, add tests to the link module.
Comment #43
quietone commentedRight so, these errors are the same as way back in patch #31.
This patch adds deprecation notices on all the cckfield plugin classes and removes some extra spaces on a line d7/LinkCckTestphp.
Comment #45
quietone commentedThat is as expected and there are no new errors. The next addition is to move the two tests in the text module. This will put them in the same tree structure as the other tests.
Comment #47
heddnNeeded a re-roll. Doing that first. Next up the test failures.
Comment #48
heddnNeeded a re-roll. Doing that first. Next up the test failures.
Comment #49
heddnThose patches in #47 & #48 are bad. They dropped a LOT of code. Working on that.
Comment #50
heddnOK, the reason for the failures when converting to KTB was that there wasn't a call to parent::setUp(). Here's a fix for that. Let's see how it fairs.
Comment #52
quietone commented@heddn, thanks. I've added @legacy to the remaining tests. However, still getting errors on link/tests/src/Kernel/Plugin/migrate/cckfield/d7/LinkCckTest.php. Apparently, @legacy has no effect for KTB?
Comment #54
quietone commentedMissed an @group, and add @group legacy to file/tests/src/Kernel/Migrate/process/d6/CckFileTest.php.
Comment #56
quietone commentedTest passing now, setting to NR.
Comment #57
jibranWith following git config settings:
and to reduce the patch size just reroll the patch.
Comment #58
maxocub commentedAssigning for review
Comment #59
maxocub commentedNice work. This is a big patch. I'll certainly miss some things, but here is what I found so far:
1.
... and other places.
Sometimes it's 8.3.x and other times it's 8.4.x, I think it should be 8.4.x everywhere.
2.
Extra line.
3.
... and other places.
Extra 'be', and this will also fix the 80 characters limit.
4.
Why this is the only class that we empty and make extend the new class? All the other ones are just copied.
5.
Why do we sometimes only add the @trigger_error, and other times we add @trigger_error and @deprecated?
6.
I know that in #2842222: D7 Plain text fields incorrectly migrated to D8 as Text (formatted) we will need a dedicated D7 TextField plugin. Should we already put this one in the d6 namespace, thus avoiding us to make another copy and have another deprecated class, or will it be ok to just leave it here and just add the new one in the d7 namespace?
7.
After this patch gets in, there will still be some reference to cck in some other places (NodeDerivers, TaxonomyTermDerivers, FieldType process plugin, etc.). This patch being big as it is, I guess we should have a follow up to see where we could and can clean things up.
Comment #60
quietone commented1. All deprecation notices should now be using 8.4
2. Fixed
3. Fixed
4. TODO
5. Added missing class deprecation notices to deprecated classes.
6. TODO
7. TODO
Comment #61
heddnHowever, we get away with it here, because this is a process plugin. The rest of the changes in here are for field plugins, not process plugins.
Comment #62
maxocub commentedThanks quietone & heddn, I'll review this more extensively tonight, but in the meantime, there's still some extra 'be' left and 80 characters limit left:
Comment #64
heddnThe 80 character limit doesn't seem to generally apply for trigger_errors. It isn't a comment. But that brings up a good point. We've been line wrapping these, but I don't see that done anywhere else in core.
Comment #65
heddnHopefully this fixes up the tests.
Comment #68
heddnComment #70
quietone commentedThis should fix the text tests. Made a d6 and d7 version. I've added a diff and not an interdiff because interdiff output makes no sense at all.
Comment #73
joelpittetConflicting with this RTBC issue currently: #2896507: Update FieldPluginBase with a default processFieldValues() and getFieldFormatterMap()
Comment #74
phenaproximaI'ma fix those broken tests.
Comment #75
phenaproximaThis should fix the broken test.
Comment #77
maxocub commentedAgain, this should fix the broken tests.
Comment #79
maxocub commentedOups, missed one.
Related CR: https://www.drupal.org/node/2896537
Comment #80
heddnTests fixed. Change record linked. Ready for RTBC again. If its a choice between this or #2896507: Update FieldPluginBase with a default processFieldValues() and getFieldFormatterMap(), I prefer to see this land first. The other one is much easier to re-roll.
Comment #81
maxocub commentedAgreed, RTBC +1
Comment #82
catchSorry I missed the comment in #80, would have been better to post it on that issue maybe. Sending for re-test.
Comment #84
maxocub commentedRe-rolled.
Comment #85
joelpittetre-RTBC'd. I diffed the diffs to ensure things didn't change in any significant way.
Comment #86
heddnI'm curious what the missing file is in between these two patches.
#79:
59 files changed, 1234 insertions, 252 deletions.
#84:
58 files changed, 1234 insertions, 220 deletions.
core/modules/migrate_drupal/tests/modules/migrate_field_plugin_manager_test/src/Plugin/migrate/cckfield/d6/FileField.php was in #79.
I think we missed a file.
Comment #87
joelpittetSorry, I miss-read that diff change I thought it was removed hunks from an existing deleted file, not a missing deleted file. Here's the change to bring it back to a reroll of #79.
Comment #88
joelpittetNeeded the following in my git to get it to look like @maxocub's.
Comment #89
heddnRTBC now. The only non-context changes were for getFieldFormatterMap, which is what the re-roll was all about. And we're good there now.
Comment #90
catchCommitted/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!
Comment #92
heddnI think this deserves a mention in the release notes. Thanks everyone for all the effort on this and the previous issue. A huge effort by all.
Comment #94
maxocub commentedComment #95
maxocub commented