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!

CommentFileSizeAuthor
#7 2278613-7.patch4.81 KBbenjy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Title: Body text is blank for migrated content types » Body text display is blank for migrated content types
ultimike’s picture

ultimike’s picture

Hmm - 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?

ultimike’s picture

Some 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

benjy’s picture

Hmm, 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.

Berdir’s picture

You 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.

benjy’s picture

Status: Active » Needs review
FileSize
4.81 KB

Berdir, 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.

ultimike’s picture

Status: Needs review » Reviewed & tested by the community

This 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

Berdir’s picture

Looks 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().

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 474ec90 and pushed to 8.0.x. Thanks!

  • alexpott committed 474ec90 on 8.0.x
    Issue #2278613 by benjy | Ryan Weal: Fixed Body text display is blank...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sopranos’s picture

I have same problem, body is there when editing teh node, the text is there, but when i press save or preview, it is empty

bisonbleu’s picture

I 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)

  • Align images
  • Caption images
  • Correct faulty and chopped off HTML
  • Track images uploaded via Text Editor

To just

  • Limit allowed HTML tags and correct faulty HTML

Resetting to default settings fixed the issue.