AssertionError: Cannot load the "date_format" entity with NULL

Created on 3 June 2025, about 1 month ago

In a fresh installation on Drupal 11, I received the generic "The website encountered an unexpected error. Try again later." error message. In log file I found:

AssertionError: Cannot load the "date_format" entity with NULL ID. in assert() (line 261 of [...]core\lib\Drupal\Core\Entity\EntityStorageBase.php).

Investigating, I found a problem in: includes\_solo_theme_preprocess.inc. The problem in my installation is that
the output of

$d_format = theme_get_setting('site_node_date_format');

at line 712 is empty.

I solved adding another check, so lines 715 and further will be:

 if (
    $d_format !== 'none' &&
    !empty($d_format<) &&   //adding this
    !empty($variables['date']) &&
    !empty($variables['display_submitted']) &&
    $variables['display_submitted'] === TRUE
  ) {

Can anybody confirm?

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇹Italy francoud

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

Comments & Activities

  • Issue created by @francoud
  • 🇺🇸United States flashwebcenter Austin TX

    Hello,

    Thank you for reporting this. I can confirm this behavior occurs on a fresh Drupal 11 installation.


    The warning has been resolved, and the development version has been updated accordingly.

    Best regards,
    Alaa

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Hello,

    The same error occurs with Solo 1.0.20 on D10.5.1, producing a WSOD with the message:
    "The website encountered an unexpected error. Try again later."

    In the logs, here what is displayed:

    Message:
    AssertionError: Cannot load the "date_format" entity with NULL ID. in assert() (line 261 of [...]/core/lib/Drupal/Core/Entity/EntityStorageBase.php).
    
    Backtrace:
    #0 [...]/core/lib/Drupal/Core/Entity/EntityStorageBase.php(261): assert(false, 'Cannot load the...')
    #1 [...]/core/lib/Drupal/Core/Datetime/DateFormatter.php(338): Drupal\Core\Entity\EntityStorageBase->load(NULL)
    #2 [...]/core/lib/Drupal/Core/Datetime/DateFormatter.php(125): Drupal\Core\Datetime\DateFormatter->dateFormat(NULL, 'it')
    #3 [...]/themes/contrib/solo/includes/_solo_theme_preprocess.inc(722): Drupal\Core\Datetime\DateFormatter->format('1371997232', NULL)
    #4 [internal function]: solo_preprocess_node(Array, 'node', Array)
    #5 [...]/core/lib/Drupal/Core/Theme/ThemeManager.php(261): call_user_func_array('solo_preprocess...', Array)
    #6 [...]/core/lib/Drupal/Core/Render/Renderer.php(490): Drupal\Core\Theme\ThemeManager->render('node', Array)
    #7 [...]/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
    #8 [...]/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(238): Drupal\Core\Render\Renderer->render(Array, false)
    #9 [...]/core/lib/Drupal/Core/Render/Renderer.php(637): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
    #10 [...]/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(239): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #11 [...]/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
    #12 [...]/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
    #13 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
    #14 [...]/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
    #15 [...]/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
    #16 [...]/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #17 [...]/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #18 [...]/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #19 [...]/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #20 [...]/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #21 [...]/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #22 [...]/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #23 [...]/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #24 [...]/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #25 [...]/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #26 [...]/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #27 [...]/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #28 [...]/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #29 {main}

    This doesn't occur if Solo is disabled and Olivero enabled instead, or if Solo 1.0.x-dev is used.

    Therefore, do you know when the new stable Solo version is going to be released?

  • 🇺🇸United States flashwebcenter Austin TX

    Hello,

    Version 1.0.21 has been released and is now available for use.

    Best regards,
    Alaa

Production build 0.71.5 2024