When migrating a site from D7 to D8, my custom block showed no content. I thought it was just a problem with displaying the content, but when I tried to edit the block content there was no body field.
It turns out the body field is just set to disabled on both "manage display" and "manage form display."



| Comment | File | Size | Author |
|---|---|---|---|
| #20 | interdiff-15-20.txt | 2.26 KB | gaurav.kapoor |
| #20 | 2724903-20.patch | 6.4 KB | gaurav.kapoor |
| #18 | interdiff-15-18.txt | 9.66 KB | gaurav.kapoor |
| #18 | 2724903-18.patch | 6.65 KB | gaurav.kapoor |
| #15 | 2724903-15.patch | 6.32 KB | jofitz |
Comments
Comment #2
rocketeerbkw commentedI added a new migration template to fix (I think) the form display issue.
Comment #3
rocketeerbkw commentedThis patch adds a migration template to fix the manage display issue.
Comment #5
rocketeerbkw commentedFixing the tests.
Comment #7
rocketeerbkw commentedHad a typo in the last patch.
Comment #8
mikeryanComment #9
rocketeerbkw commentedI changed the "manage display" migration to hide the label by default and added tests for "manage display" and "manage form display."
Comment #11
mikeryanLooks good!
Comment #14
mikeryanComment #15
jofitzUpdated the migration templates.
Comment #16
phenaproximaThis test is in the wrong group.
Should have @inheritdoc comment.
Let's use
$this->assertInternalType('array', $component).Should be assertSame().
Wrong group, again.
Needs @inheritdoc.
As before, should use assertInternalType().
Should be assertSame().
Comment #17
gaurav.kapoor commentedComment #18
gaurav.kapoor commentedComment #20
gaurav.kapoor commentedComment #21
phenaproximaI'm trying to find objectionable things in this patch but I can't. Well done, all!
Comment #23
gaurav.kapoor commentedLooks like a random failure to me , should be moved back to RTBC.
Comment #24
quietone commented@gaurav.kapoor, I agree. Back to RTBC.
Comment #25
alexpottComment #26
alexpottSo these things are shipped with standard - what happens if this migration runs on standard? Do we get duplicates? Setting back to needs review to get an answer.
Comment #27
phenaproximaAssigning to myself to discover the answer to @alexpott's question.
Comment #28
heddnThis could also be a fairly easy novice. Apply the patch and manually try to migrate a D7 site into D8 and see if duplicate block fields appear.
Comment #29
phenaproxima@alexpott: The PerComponentEntityDisplay and PerComponentEntityFormDisplay destination plugins call entity_get_display() and entity_get_form_display(), respectively, so they should load the displays that ship with standard. Their shared base class then calls setComponent() on the display, so if the body field was already there, it will be overwritten with the incoming data rather than duplicated.
I'm not sure how else we could test this, beyond what we're already doing. So I think this can go back to RTBC.
Comment #30
alexpottI would have expected a change to \Drupal\migrate_drupal_ui\Tests\d6\MigrateUpgrade6Test::getEntityCounts() and the d7 version too. I guess that is not happening because the form and view displays are being created anyway by the creation of the block type. This is one of the reasons why these secondary configuration writes are tricky to manage and should be on the UI level and not the API. Makes it much easier to spot things like this - not the fault of the migration system though. What I can't work out atm is what code is actually responsible for creating the form and view displays magically.
Comment #32
phenaproximaThere have been no updates. Drupal CI is just mocking us.
Comment #33
alexpottCommitted and pushed 631e8d8 to 8.4.x and b9cdeaa to 8.3.x. Thanks!
As migrate is still experimental and this is an addition for something that is missing backporting to 8.3.x
Comment #37
Anonymous (not verified) commentedGetting MigrateSkipRowException whenever trying to migrate a block from D7 to D8. Applied the patch in Drupal 8.2.
Comment #38
heddn@JohnOku, please open a follow-up support request. This has already landed and is fixed.