AssertionError: Cannot load the "date_format" entity with NULL

Created on 3 June 2025, 4 days 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

Production build 0.71.5 2024