The "block_content" entity type did not specify a workspace handler.

Created on 15 February 2025, 3 months ago

Problem/Motivation

My entire site is down. Watchdog exception indicates the following:

Error Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "block_content" entity type did not specify a workspace handler. in Drupal\Core\Entity\EntityTypeManager->getHandler() (line 299 of /var/www/html/sunraz-dev/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php).

Steps to reproduce

The error was displayed prior to the update, but I updated my Drupal core from 10.0 to to 10.4. The error was presented when I executed "drush cr".

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

10.4 ✨

Component

entity system

Created by

πŸ‡ΊπŸ‡ΈUnited States robertmartin1961

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

Comments & Activities

  • Issue created by @robertmartin1961
  • That is unfortunate however line 299 of core/lib/Drupal/Core/Entity/EntityTypeManager.php doesn't have an exception throw (it is a comment), so maybe the upgrade process you took didn't replace Drupal files as expected, or, you the site has patches or other adjustments that modify Drupal Core. More information is needed from you to further an investigation here.

  • πŸ‡ΊπŸ‡ΈUnited States robertmartin1961

    cilefen In order to push pass this error, I hacked a patch for a similar issue reported for the the "commerce promo code" module by adding the following within
    "public function getHandler($entity_type_id, $handler_type)" in EntityTypeManager.php:

    // If the translation handler for workspaces cannot be found, just add it again.
    if (! $class && $entity_type_id === "block_content" && $handler_type === 'workspaces') {
    $definition->setHandlerClass('workspaces', 'Drupal\workspaces\WorkspaceAccessControlHandler');
    $class = $definition->getHandlerClass($handler_type);
    }

    This has returned the operation of the site, but the error message does occasionally appear in my php-fpm error log file. I have applied patches to several contrib modules, but none to any core Drupal files.

  • That's interesting. Could you please get us a link to the Commerce issue you mentioned? It would also be great to get a stack trace for this exception.

  • πŸ‡ΊπŸ‡ΈUnited States robertmartin1961

    cilefen I need to withdraw my previous fix with the following explanation. I found it interesting that you mentioned the possibility of other patches that could impact Drupal core. I have previously patched quite a few modules and could not be absolutely sure that I did not apply any patches to the core. Following your comment, I decided to execute two composer commands to reinstall and update my entire Drupal installation. It made since, because successful patches eventually get merged into updated module versions and other can become obsolete for various reasons. With a new baseline for my entire Drupal installation, the error does not surface. My site is up and running. I did have to re-implement one of my previous patches that fixes an obsolete PHP syntax issue.

    Thanks for advancing my learning curve.

Production build 0.71.5 2024