Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When migrating from Drupal 7 to Drupal 8, Boolean field are created in Drupal 8, except On and Off Label are not same as there Drupal 7 counterpart.
Comment | File | Size | Author |
---|---|---|---|
#17 | 3067889-17.patch | 1.93 KB | quietone |
#13 | 3067889-13.patch | 2.15 KB | quietone |
#8 | 3067889-8.patch | 2.06 KB | quietone |
#5 | 3067889-5.patch | 1.84 KB | quietone |
#4 | 3067889-4.patch | 10.7 KB | quietone |
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedComment #3
manojbisht_drupal CreditAttribution: manojbisht_drupal as a volunteer and at QED42 for QED42 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 CreditAttribution: quietone as a volunteer 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 CreditAttribution: quietone as a volunteer 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 CreditAttribution: quietone as a volunteer commentedRerolled. The interdiff fails but it is a small patch anyway.
Comment #9
cilefen CreditAttribution: 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 CreditAttribution: quietone as a volunteer 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 CreditAttribution: quietone as a volunteer commentedReroll for 8.7
Comment #18
quietone CreditAttribution: quietone as a volunteer commentedSimple reroll for 8.7.x and tests are passing. So setting back to RTBC.
Comment #19
Gábor HojtsyThanks!