Closed (cannot reproduce)
Project:
Drupal core
Version:
8.5.x-dev
Component:
migration system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Feb 2017 at 21:12 UTC
Updated:
21 Sep 2017 at 13:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joelpittetJust need to check the value exists before trying to use it.
Comment #3
joelpittetComment #4
mikeryanLooks good, but let's see a test triggering the notice.
Comment #5
joelpittetNo idea how to test this case, it just happened on an inherited site.
Comment #6
jofitzI've added a (rather convoluted) test to trigger the notice, but I'm not familiar enough with D6 to know how this situation could occur.
@joelpittet's solution would not solve this particular problem so I have added an attempt of my own. The notice occurs when
$field_row['display_settings']['label']is not set, checking!empty($field_row['display_settings'][$view_mode])will not confirm this.I would be interested in your feedback on my interpretation.
Comment #9
joelpittetAh thanks @Jo Fitzgerald, the test case proves it and the new solution fixes it. (FYI, re RTBC, not my patch/solution)
Comment #10
alexpottI checked to see if we had a constant for this value. We don't - see \Drupal\Core\Entity\EntityDisplayBase
I guess one question here is should we put this logic here or should it go into the migration using \Drupal\migrate\Plugin\migrate\process\DefaultValue?
Comment #11
jofitz@alexpott I think it simplest to leave it here because display_settings needs unserialising before checking whether ['label']['format'] is not empty (and I for one don't know whether that's even possible without a custom process plugin).
Comment #12
quietone commentedWhat type of field causes the view mode to have no settings? I was unable to reproduce it on a D6 site. At least, lets add a comment.
Since this is just setting a value for label why can't we add a default value in the pipeline at
"options/label": label?Comment #13
mikeryanCould we get steps to reproduce here?
Thanks.
Comment #15
heddnIf steps are available to reproduce this, please reopen.