0

I have a Drupal 8 site on 8.8.6. I installed and tried to use the fancy_file_delete module version 2.0.1, however, in trying to load one of its views, /admin/config/content/fancy_file_delete/list, I got the exception

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "default_image" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 150 of core/lib/Drupal/Core/Entity/EntityTypeManager.php). 

(I'm including the full stack trace at the bottom of this question).

I grepped in our site's configuration directory, and found that the the string default_image seems to be a key for the default image settings for image files. I found this in the storage of several file fields:

field.storage.user.user_picture.yml:17:  default_image:

 15 settings:
 16   uri_scheme: public
 17   default_image:
 18     uuid: null
 19     alt: ''
 20     title: ''
 21     width: null
 22     height: null
 23   target_type: file
 24   display_field: false
 25   display_default: false

So this doesn't seem to be the missing plugin causing the exception to be thrown. We have images on all of our content types, and we aren't getting exception thrown when they load.

I looked through the git log for our config directory and didn't find deleted file that had default_image in the name. So it doesn't appear that we had something in configuration that we deleted later on. If the deletion of this entity was the result of an action that I or another developer of our site did at one point, I don't recall and am not aware of it.

I googled the string of the exception message, and found a couple hits. However, none of them led me to be able to fix the exception. This issue remains an open issue on the entity browser module. This patch for the simple_menu_icons module provides a fix for the same exception, but the code replaces a File::load(), which I only find in the src/FancyFileDeleteBatch.php. I commented out lines 125-162 of src/FancyFileDeleteBatch.php, but that doesn't prevent the exeption from being thrown. Which makes sense-- it's the code for batch deletion, and I'm only trying to load the view.

How can I troubleshoot this exception? Is this an entry for a missing entity, that I can just delete? Or does the code of the module need to be rewritten?


What follows is the exception that I get and its full stack trace:

The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "default_image" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 150 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).

Drupal\Core\Entity\EntityTypeManager->getHandler('default_image', 'storage') (Line: 208)
Drupal\Core\Entity\EntityTypeManager->getStorage('default_image') (Line: 139)
Drupal\views\Plugin\views\field\EntityLabel->preRender(Array) (Line: 1503)
Drupal\views\ViewExecutable->render() (Line: 183)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1630)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 77)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func_array(Array, Array) (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725', 'silenced_deprecation', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.