Skip to content
Snippets Groups Projects

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

Open Issue #3202244: TypeError: Argument 1 passed to Drupal\default_content\Normalizer\ContentEntityNormalizer::addDependency() must implement interface Drupal\Core\Entity\ContentEntityInterface, null given
2 unresolved threads
2 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 4ed9430f - Add fixes from https://www.drupal.org/files/issues/2023-10-25/3202244-11.patch...

    Compare with previous version

  • 121 121 if (strpos($entity->getParentId(), PluginBase::DERIVATIVE_SEPARATOR) !== FALSE) {
    122 122 [$plugin_id, $parent_uuid] = explode(PluginBase::DERIVATIVE_SEPARATOR, $entity->getParentId());
    123 123 if ($plugin_id === 'menu_link_content' && $parent_entity = $this->entityRepository->loadEntityByUuid('menu_link_content', $parent_uuid)) {
    124 $this->addDependency($parent_entity);
    124 if ($parent_entity instanceof ContentEntityInterface) {
    • the if around this already checks that parent_entity could be loaded. that's sufficient, we know it's a menu_link_content entitiy, that's always a content entity. this change can be reverted.

    • Please register or sign in to reply
  • 415 417 $value = $this->normalize($target);
    416 418 }
    417 419 else {
    418 $this->addDependency($target);
    419 $value = $target->uuid();
    420 if ($parent_entity instanceof ContentEntityInterface) {
    Please register or sign in to reply
    Loading