Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
migration system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Jul 2019 at 12:33 UTC
Updated:
6 Sep 2019 at 12:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
cilefen commentedComment #3
manojbisht_drupal commentedWe have to transform in FieldInstanceSettings, to something like this.
if ($row->getSourceProperty('type') == "list_boolean") {
$instance_settings['on_label'] = $field_settings['allowed_values'][1];
$instance_settings['off_label'] = $field_settings['allowed_values'][0];
}
Ned some thought, after that I can create patch.
Comment #4
quietone commentedAnd here is a patch with a test.
Not sure why this is migrate critical, so removing the tag. Please let me know if I am wrong about that.
Comment #5
quietone commentedIgnore previous patch. I seem to be making quite a few bad patches in the last 24 hours.
Comment #6
heddnPretty reasonable (and simple) solution here. Test coverage and a quick break/fix.
Comment #7
larowlanthis doesn't apply on 8.8, can we get a patch for 8.8?
Thanks
Comment #8
quietone commentedRerolled. The interdiff fails but it is a small patch anyway.
Comment #9
cilefen commentedAFAIK interdiffs are impossible by definition on a reroll.
Comment #10
alisonre: rerolling + interdiff: that's right!
More info: https://www.drupal.org/documentation/git/interdiff#reroll
Comment #11
heddnAnd back to RTBC.
Comment #12
larowlanshould we be checking that these keys exists first to avoid warnings, we have null coalesce now, saves us triggering a warning?
Comment #13
quietone commented$field_data = unserialize($field_definition['data']);is actually done earlier and it will exist so it shouldn't be repeated here.Instead of using coalesce this should really only set $instance_settings if there was an allowed value in the source.. The creation of the field will setup the default on/off labels so there is no need to do that here.
No interdiff since this is small patch.
Comment #14
mikelutzLGTM
Comment #16
larowlanCommitted 11c62ac and pushed to 8.8.x. Thanks!
Needs re-roll for 8.7.x
Comment #17
quietone commentedReroll for 8.7
Comment #18
quietone commentedSimple reroll for 8.7.x and tests are passing. So setting back to RTBC.
Comment #19
gábor hojtsyThanks!