Fix error on deleting Cacheflush entity

Created on 27 April 2023, about 1 year ago
Updated 3 December 2023, 7 months ago

Problem/Motivation

Message Message TypeError: Drupal\cacheflush_ui\Entity\Form\CacheflushEntityDeleteForm::__construct(): Argument #2 ($messenger) must be of type Drupal\Core\Messenger\MessengerInterface, Drupal\Core\Entity\EntityTypeBundleInfo given, called in /code/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php on line 69 in Drupal\cacheflush_ui\Entity\Form\CacheflushEntityDeleteForm->__construct() (line 33 of /code/web/modules/contrib/cacheflush/modules/cacheflush_ui/src/Entity/Form/CacheflushEntityDeleteForm.php)

Steps to reproduce

  1. Enable Cacheflush, CacheFfush UI, and Cacheflush Entity modules
  2. Go to Structure ->Cacheflush ->Add new
  3. Fill out the form (only title is required) and save. (may result in a separate unrelated error)
  4. Go to Structure ->Cacheflush
  5. Next to the new entity, select the arrow to expand the dropdown menu and select Delete. This should go to a white error page.

Proposed resolution

In CacheflushEntityDeleteForm, remove MessengerInterface $messenger from __construct since it is no longer passed it, but is already managed via MessengerTrait in FormBase. Usage of $this->messenger should be change to $this->messenger().

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kelly.m.jacobs

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

Comments & Activities

Production build 0.69.0 2024