Score:0

My site content does not display after upgrading to Drupal 9

in flag

I've just completed upgrading three sites (in a multi-site configuration) from Drupal 7 to 9. For the first two simple sites, all is well. However for the third site, which has its own content types that make use of many field types, things are not so good.

When I view any node of any type (eg. page, story, one of my custom types), whether in teaser mode on the home page or in full mode, only the title is displayed. The summary text, body and any fields are not.

I've checked the DB and the content was migrated successfully, eg. the summary, body and so on is present. Similarly, if I edit any node, I can see the body.

The problem occurs when using the standard Bartik theme. I was using a subtheme of Garland on D7. I switched to a subtheme of Bartik (using Twig templates) for D9 and this works fine on my two simple sites.

I've turned on Twig debugging and this is what I see in the output:

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'field' -->
<!-- FILE NAME SUGGESTIONS:
   * field--node--body--match-report.html.twig
   * field--node--body.html.twig
   * field--node--match-report.html.twig
   * field--body.html.twig
   x field--text-with-summary.html.twig
   * field.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/bartik/templates/classy/field/field--text-with-summary.html.twig' -->

        <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"></div>
  
<!-- END OUTPUT from 'core/themes/bartik/templates/classy/field/field--text-with-summary.html.twig' -->

So it would appear that the body field is being rendered, but with not actual value. That is, the field--text-with-summary.html.twig template is executed, however nothing is rendered.

At @2pha's suggestion, I've checked the logs and found the following two errors of type migrate_drupal_ui occurred during the upgrade many times over:

Source ID 282: Missing bundle for entity type node (/home/foo/drupal-9.3.2/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:124)
Missing bundle for entity type node (/home/foo/drupal-9.3.2/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:124)

The following error occurred a few times post-upgrade:

A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: node, bundle: image, field name: taxonomyextra

I've played around for a while and I'm now stuck. Any suggestions on how to debug this further?

2pha avatar
pk flag
Are you using custom templates? Drupal 8 moved to twig templates.
in flag
I am. However the problem also occurs when using the Bartik theme. I was using a subtheme of Garland on D7. I saw the change to Twig for D8/9 and I'm now using a subtheme of Bartik. The subtheme works fine on my two simple sites.
Kevin avatar
in flag
Not enough details here. Either the Main Content block is not placed, you are not printing the content region, the theme is wrong (somehow?) or a number of other things.
2pha avatar
pk flag
Did you check the log messages? (/admin/reports/dblog)..Have you set your site to [show all errors](https://www.drupal.org/docs/7/creating-custom-modules/show-all-errors-while-developing)? Do you have custom preprocess functions? Anyway, like Kevin says, not enough details
in flag
@2pha thanks for the tip - I've checked the logs and found a few errors. I've added them to the original question.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.