Added the "Rabbit Hole media entity" option for Rabbit Hole. Now I cannot log in. When I try to login to the site I get the following (below). I have cleared all cache tables in database, to no avail. Would be grateful for any assistance to resolve this. Thank you!

Begin error message:

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

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "media" 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('media', 'storage') (Line: 208)
Drupal\Core\Entity\EntityTypeManager->getStorage('media') (Line: 97)
Drupal\rabbit_hole\Plugin\RabbitHoleEntityPluginManager->Drupal\rabbit_hole\Plugin\{closure}(Array)
array_map(Object, Array) (Line: 99)
Drupal\rabbit_hole\Plugin\RabbitHoleEntityPluginManager->loadSupportedBundleEntityTypes() (Line: 57)
rabbit_hole_form_alter(Array, Object, 'user_login_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'user_login_form') (Line: 836)
Drupal\Core\Form\FormBuilder->prepareForm('user_login_form', Array, Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
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: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
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)
CommentFileSizeAuthor
#6 rabbit_hole-3134221-6.patch321 bytesmatroskeen

Comments

jhnnsbstnbch created an issue. See original summary.

jhnnsbstnbch’s picture

Issue summary: View changes
jhnnsbstnbch’s picture

Issue summary: View changes
jhnnsbstnbch’s picture

Please disregard, I uploaded a backup. Thank you.

vcastillo’s picture

I am getting this error as well, after installing rabbit hole on a Drupal 8.9.2 , I am getting following error on most admin pages and front-end

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

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

I think the issue may be cause the sub module rh_media does not have a dependency on Media which was disabled in my installation, after enabling the Media module manually I got the site back.

matroskeen’s picture

Status: Active » Needs review
StatusFileSize
new321 bytes

That looks like something that should be fixed.

  • Matroskeen committed e0a4af2 on 8.x-1.x
    Issue #3134221 by Matroskeen, vcastillo: The "media" entity type does...
matroskeen’s picture

Status: Needs review » Fixed

Committed to 8.x-1.x.
Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

therobyouknow’s picture

Same problem in 8.x-1.0-beta7

(1 beta releaase ahead of the release where this issue was found: 8.x-1.0-beta6)

Fortunately, the solution to the problem is the same as in #6 https://www.drupal.org/project/rabbit_hole/issues/3134221#comment-13826242 to add Drupal Media module as module that rh_media rabbit_hole submodule depends on, which my Drupal Watchdog recent db log error corroborates as also described above.

Enabling Drupal Media means that the fatal "Unexpected Error..." no longer occurs.

I would say that "Closed (fixed)" should mean that the fix is actually in the latest non-dev (i.e. alpha/beta/stable) release of the module.

In this case, it would appear that it is not the case, looking at the rh_media.info.yml file, Media is not listed as a dependency:

web/modules/contrib/rabbit_hole/modules/rh_media/rh_media.info.yml

name: Rabbit Hole media entity
type: module
description: Adds Rabbit Hole functionality for media entity.
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
  - rabbit_hole:rabbit_hole

# Information added by Drupal.org packaging script on 2020-06-09
version: '8.x-1.0-beta7'
project: 'rabbit_hole'
datestamp: 1591667438

Nor is the dependency listed in parent module, which rh_media depends on:

web/modules/contrib/rabbit_hole/rabbit_hole.info.yml

name: Rabbit Hole
type: module
description: Basic functionality that is shared among the different Rabbit Hole modules.
core: 8.x
core_version_requirement: ^8 || ^9
package: Other

# Information added by Drupal.org packaging script on 2020-06-09
version: '8.x-1.0-beta7'
project: 'rabbit_hole'
datestamp: 1591667438

However, I do note that the fix to include Drupal Media as a dependency is in the 8.x-1.x-dev at time of writing.

Thank you.