TypeError: EntityInterface Null when Deleting Block in BlockUsageReportController

Created on 22 October 2024, about 1 month ago

Problem/Motivation

When deleting a block, the following error occurs:

TypeError: Drupal\Core\Entity\EntityListBuilder::getOperations(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/web/modules/contrib/block_usage_report/src/Controller/BlockUsageReportController.php on line 344 in Drupal\Core\Entity\EntityListBuilder->getOperations() (line 123 of core/lib/Drupal/Core/Entity/EntityListBuilder.php).

Steps to reproduce

The error happens when attempting to delete a block.

It seems that the method getOperations receives a null value instead of an EntityInterface.

Additional Context

Drupal core: 10.3.5
PHP: 8.2.15

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇵🇹Portugal developer-rocha

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