Error when trying to delete a image style

Created on 17 January 2024, 10 months ago
Updated 19 January 2024, 10 months ago

Hello again :)

Problem/Motivation

I was organizing my image styles and I have 4 that I don't need anymore.
When I try to delete one, I get this error

The website encountered an unexpected error. Try again later.

TypeError: _media_contextual_crop_field_formatter_get_media_contextual_fields(): Argument #1 ($entity) must be of type Drupal\Core\Entity\FieldableEntityInterface, Drupal\image\Entity\ImageStyle given, called in /var/www/html/donestech10.devel/web/modules/contrib/media_contextual_crop_field_formatter/media_contextual_crop_field_formatter.module on line 186 in _media_contextual_crop_field_formatter_get_media_contextual_fields() (line 125 of modules/contrib/media_contextual_crop_field_formatter/media_contextual_crop_field_formatter.module).

media_contextual_crop_field_formatter_entity_delete()
call_user_func_array() (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 343)
Drupal\Core\Config\Entity\ConfigEntityStorage->invokeHook() (Line: 462)
Drupal\Core\Entity\EntityStorageBase->delete() (Line: 360)
Drupal\Core\Entity\EntityBase->delete() (Line: 122)
Drupal\Core\Entity\EntityDeleteForm->submitForm() (Line: 70)
Drupal\image\Form\ImageStyleDeleteForm->submitForm()
call_user_func_array() (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 597)
Drupal\Core\Form\FormBuilder->processForm() (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
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: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
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: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

  • Install all the modules required by this module
  • Delete one image style

Thanks a lot :)

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇪🇸Spain candelas

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

Comments & Activities

Production build 0.71.5 2024