TypeError: Argument 1 passed to Drupal\default_content\Normalizer\ContentEntityNormalizer::addDependency() must implement interface Drupal\Core\Entity\ContentEntityInterface, null given

Created on 8 March 2021, about 4 years ago
Updated 24 August 2024, 7 months ago

Problem/Motivation

When exporting a node, I receive the error:

TypeError: Argument 1 passed to Drupal\default_content\Normalizer\ContentEntityNormalizer::addDependency() must implement interface Drupal\Core\Entity\ContentEntityInterface, null given

Is it true that in the first place there shouldn't be stale entity references, but I don't want to know what entity I've lost, I just want to export the actual entity.

Steps to reproduce

Having default content imported in the site and trying to export content that has stale links (pointing to unexisting entities), using the command 'drush default-content:export-references'

Proposed resolution

Checking the loaded URI entity exists after loading it.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇪🇸Spain omarlopesino

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024