Domain Access: Error: Call to a member function id() on null in Drupal\domain\Access\DomainRouteCheck->access() (line 74 of modules/contrib/domain/domain/src/Access/DomainRouteCheck.php).

Created on 20 June 2024, 5 months ago
Updated 23 July 2024, 4 months ago

Drupal Version

10.2.6

Domain module version

2.0.0-beta1

Expected Behavior

[What did you try to do? What URL did you use to do it?]
There are three sub-domains, each domain as a separate frontpage view, the Access is set to Domain. Try to put block contents on these frontage views.

Actual Behavior

[What actually happened?]
successfully put two block contents on the frontpages of domian A and B with restricts Domain and pages, while the third block content on the frontpage of domain C does not show up except for the Administrator, and after enabling debugging, an exception is thrown:

Error: Call to a member function id() on null in Drupal\domain\Access\DomainRouteCheck->access() (line 74 of modules/contrib/domain/domain/src/Access/DomainRouteCheck.php).
call_user_func_array() (Line: 160)
Drupal\Core\Access\AccessManager->performCheck() (Line: 136)
Drupal\Core\Access\AccessManager->check() (Line: 113)
Drupal\Core\Access\AccessManager->checkRequest() (Line: 107)
Drupal\Core\Routing\AccessAwareRouter->checkAccess() (Line: 92)
Drupal\Core\Routing\AccessAwareRouter->matchRequest() (Line: 144)
Drupal\Core\Routing\AccessAwareRouter->match() (Line: 138)
Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin->isAdminPath() (Line: 104)
Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin->getLangcode() (Line: 197)
Drupal\language\LanguageNegotiator->negotiateLanguage() (Line: 137)
Drupal\language\LanguageNegotiator->initializeType() (Line: 218)
Drupal\language\ConfigurableLanguageManager->getCurrentLanguage() (Line: 237)
Drupal\domain_config\DomainConfigOverrider->initiateContext() (Line: 120)
Drupal\domain_config\DomainConfigOverrider->loadOverrides() (Line: 209)
Drupal\Core\Config\ConfigFactory->loadOverrides() (Line: 169)
Drupal\Core\Config\ConfigFactory->doLoadMultiple() (Line: 68)
Drupal\domain_config_ui\Config\ConfigFactory->doLoadMultiple() (Line: 104)
Drupal\Core\Config\ConfigFactory->doGet() (Line: 109)
Drupal\domain_config_ui\Config\ConfigFactory->doGet() (Line: 89)
Drupal\Core\Config\ConfigFactory->get() (Line: 90)
Drupal\system\TimeZoneResolver->getTimeZone() (Line: 53)
Drupal\system\TimeZoneResolver->setDefaultTimeZone()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 65)
Drupal\Core\Session\AccountProxy->setAccount() (Line: 79)
Drupal\Core\EventSubscriber\AuthenticationSubscriber->onKernelRequestAuthenticate()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 157)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

[A bullet list of steps to reproduce the error. Note if the error always happens or sometimes happens.]
1. Create three domains
2. Create three frontpages for these domains with Access: Domian, and set these as the frontpages of these domains through System-->Basic site settings
4. Create block content and put to each frontpage through block layout with restricts Domain and pages
All these block contents are the same and the the situation remains the same even remove the restricts.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇳China hongqing

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024