TypeError when viewing a revision

Created on 29 July 2025, about 1 month ago

Problem/Motivation

When trying to view a revision of a sitewide alert, the following error occurs:

The website encountered an unexpected error. Try again later.

TypeError: Drupal\Core\Entity\EntityViewBuilder::view(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, Drupal\Core\Entity\Sql\SqlContentEntityStorage given, called in /var/www/html/docroot/modules/contrib/sitewide_alert/src/Controller/SitewideAlertController.php on line 70 in Drupal\Core\Entity\EntityViewBuilder->view() (line 122 of core/lib/Drupal/Core/Entity/EntityViewBuilder.php).
Drupal\sitewide_alert\Controller\SitewideAlertController->revisionShow()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
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: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->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: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

1. edit a sitewide alert
2. tick theCreate new revision checkbox
3. save
4. go to revisions
5. click on one of the revisions

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom malcomio

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

Comments & Activities

Production build 0.71.5 2024