Fatal error trying to display Domain Source field on node with no domain

Created on 19 January 2024, 5 months ago
Updated 12 June 2024, 16 days ago

Drupal Version

We are still running 9.5.4

Domain module version

2.0.x-dev

Expected Behavior

After adding the Domain Source field to the form display for a node type, I tried to edit an existing node. This is all migrated content from Drupal 7.

Actual Behavior

I got a fatal error (error text on white screen) with a stack trace:

The website encountered an unexpected error. Please try again later.
AssertionError: Cannot load the "domain" entity with NULL ID. in assert() (line 295 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
assert() (Line: 295)
Drupal\Core\Entity\EntityStorageBase->load() (Line: 116)
domain_source_get() (Line: 163)
Drupal\domain_source\HttpKernel\DomainSourcePathProcessor->processOutbound() (Line: 108)
Drupal\Core\PathProcessor\PathProcessorManager->processOutbound() (Line: 388)
Drupal\Core\Routing\UrlGenerator->processPath() (Line: 297)
Drupal\Core\Routing\UrlGenerator->generateFromRoute() (Line: 105)
Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute() (Line: 68)
Drupal\Core\Routing\RedirectDestination->get() (Line: 373)
redirect_form_node_form_alter() (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 838)
Drupal\Core\Form\FormBuilder->prepareForm() (Line: 282)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

I also got the error by creating a node in this content type, which worked although I did not see the Domain Source field, and then trying to edit that node.

Switching from autocomplete to select list, I was able to edit the new node.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

- Domain Source

Created by

πŸ‡ΊπŸ‡ΈUnited States brad.bulger

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024