Closed (fixed)
Project:
Drupal core
Version:
8.3.x-dev
Component:
migration system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Sep 2016 at 11:07 UTC
Updated:
23 Sep 2017 at 15:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
maxocub commentedComment #3
maxocub commentedComment #5
gábor hojtsyWhy do you still have the variables key here given the plugin does not use it anymore?
Any reason not to extend from the Variable plugin directly? Too messy?
Comment #6
maxocub commentedRe #5:
Comment #7
gábor hojtsyOk, I trust that you considered extending the variable plugin and this was cleaner. The implementation and tests look fine.
Comment #8
quietone commentedThx maxocub. Can you say why the source plugin isn't extended from Variable? To me that would be cleaner. Either way, the new source plugin needs tests.
I know this was RTBC but I've had to rework patches to not use assertIdentical and assertEqual. Kinda confused by the inconsistency of that.
Comment #9
maxocub commented@quietone: Thanks for the review, those are valid points. First off, me too I had to rework patches to not use assertIdentical and assertEqual, so I converted those to assertSame.
That was the easy part.
For the rest, here's the short story:
Now the long story:
What do you think?
Comment #10
maxocub commented@phenaproxima had the excellent idea that we use \Drupal\Component\Serialization\Json::encode & decode, thus not needing the get_object_vars callback anymore. Here's the updated patch.
Comment #11
quietone commentedWow, nice record of your journey on this patch. And neat way to avoid a new source plugin and associated tests.
There is a comment on the callback handbook page that additional arguments can be passed to the callback as this would make the migration YAML file too complex. Which you too discovered.
I agree with phenaproxima's comment about the tests being unusual.
Comment #12
maxocub commentedSome comments improvements suggested by @phenaproxima on IRC.
Comment #13
gábor hojtsyWoah, nice trick, and thanks for documenting how you got there. Let's get this in then :)
Comment #15
maxocub commentedThat looks like random fail. Let's re-roll.
Comment #16
gábor hojtsyUnrelated fail in Node.Drupal\node\Tests\NodeTypeTranslationTest.
Comment #18
maxocub commentedAnother unrelated fail...
Comment #19
gábor hojtsyComment #20
catchIsn't there a skip_on_empty option? This looks like a clever way to do a no-op at the moment.
Comment #21
gábor hojtsy@catch: if the D6/D7 site did not have a language_default variable, it means its default language was English. It does not mean that its default language was the same as whatever the default language is on the target site. So logically at least, the information that the default language is English should be migrated to the target site as opposed to not changing the default language of the target site at all.
Comment #22
alexpottCommitted and pushed ecd6148 to 8.3.x and f4c1f48 to 8.2.x. Thanks!
I've stared at this several times and wondered about the hackyness of this. It does not look ideal but in the long run this fixes a tricky bug and we can refactor later if someone chooses to - and we've already got a test. So nice work.
Comment #26
maxocub commentedComment #27
maxocub commented