Content types that are defined by the migration put the body field view mode settings into a new view mode called "full" rather than D8's "default" view mode. This results in the body field not being active by default.
Page and article are exempt from this if installing from the standard profile. This is because the "default" view mode already contains the body field.
Thanks to @flashwebcenter for figuring this out!
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2278613-7.patch | 4.81 KB | benjy |
Comments
Comment #1
Anonymous (not verified) commentedComment #2
ultimikeComment #3
ultimikeHmm - looking at this one, when a content type is created in D6, there are at least 2 "view modes" (even though they're not really "view modes" like we have in D7 and D8): "teaser" and "full".
Some background...
When the content type is migrated from D6 to D8, the ViewMode source plugin queries the content_node_field_instance table for all the display_settings fields for all rows (each row is a field - no title or body fields though). The display_settings fields specifies how the field is displayed in the teaser, full, and other view modes.
The ViewMode migration iterates over all the fields, creating the necessary View modes for each content type. This normally includes creating a "Full" view mode in Drupal 8 (content types created through the D8 UI only have "Default" and "Teaser" by default).
This issue is not with the creation of the View Modes (that appears to be working fine), but rather with the body field not being set with a Format of "Default" in the migrated "Full" View Mode.
I'm not sure how to proceed on this issue - can anyone point me in the right direction?
Thanks,
-mike
P.S. On a side note, I noticed that the FieldInstancePerViewMode source plugin doesn't have a corresponding configuration file, nor does it appear to be called from anywhere (via "d6_field_instance_per_view_mode"). Am I missing something here?
Comment #4
ultimikeSome additional background on this one - after the migration, this is what the "Full" display looks like on Drupal 8 - the body field isn't visible because no Format was set: http://note.io/Zh6vT8
-mike
Comment #5
benjy commentedHmm, this could almost be a "Won't Fix". Right now I would say the correct behaviour would be to create a new view mode called "Full" and then position body in the "Full" view mode when it's migrated.
It seems like the suggestion is to have some special handling to map D6's "Full" view mode to D8's "Default" view mode. If that is the case, we should also not bother migrating the "Full" view mode.
Comment #6
berdirYou are mixing up two things.
D8 has view modes and view displays.
Nodes by default have a full and teaser view mode.
Each view mode can optionally have display configuration (field formatters configuration, mostly), if not, it falls back to the default view display. The default configuration is now that teaser has a custom view display while full does not and therefore uses the default view display.
As the default migration I think targets empty sites that are upgrading from 6.x, I would say it should follow the default and configure the default view display and not full. This is consistent with what node_add_body_field() is doing.
Comment #7
benjy commentedBerdir, thanks for taking the time to explain that, it certainly had me confused :)
Patch attached maps the "full" view mode to "default" when saving the view display.
Comment #8
ultimikeThis looks fine - gotta love the process pipeline for making stuff like this easy.
I also did a quick manual test to ensure that the original issue was solved, and all looks fine.
Thanks,
-mike
Comment #9
berdirLooks good to me too, all field-related migration is node specific, so I think hardcoding that assumption is OK, we do it already in other places, like the mentioned node_add_body_field().
Comment #10
alexpottCommitted 474ec90 and pushed to 8.0.x. Thanks!
Comment #13
sopranos commentedI have same problem, body is there when editing teh node, the text is there, but when i press save or preview, it is empty
Comment #14
bisonbleu commentedI also just ran into this issue - body field contents are not displayed after the migration completes, although I can see them when editing. Migration from D7.64 to D8.6.11. Note that the D7 is itself a migration from 6.38.
I noticed that the default settings for Full HTML text format were changed during the migration:
From (default)
To just
Resetting to default settings fixed the issue.