1

What does this error message mean? How can I fix it?

User warning: The following theme is missing from the file system: media in drupal_get_filename() (line 268 of core/includes/bootstrap.inc).
drupal_get_filename('theme', 'media') (Line: 291)
drupal_get_path('theme', 'media') (Line: 394)
Drupal\Core\Asset\LibraryDiscoveryParser->drupalGetPath('theme', 'media') (Line: 85)
Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension('media') (Line: 87)
Drupal\Core\Asset\LibraryDiscoveryCollector->getLibraryDefinitions('media') (Line: 66)
Drupal\Core\Asset\LibraryDiscoveryCollector->resolveCacheMiss('media') (Line: 149)
Drupal\Core\Cache\CacheCollector->get('media') (Line: 44)
Drupal\Core\Asset\LibraryDiscovery->getLibrariesByExtension('media') (Line: 58)
Drupal\Core\Asset\LibraryDiscovery->getLibraryByName('media', 'form') (Line: 54)
Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array, Array) (Line: 56)
Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array) (Line: 31) Drupal\Core\Asset\LibraryDependencyResolver->getLibrariesWithDependencies(Array) (Line: 104)
Drupal\Core\Asset\AssetResolver->getLibrariesToLoad(Object) (Line: 116)
Drupal\Core\Asset\AssetResolver->getCssAssets(Object, ) (Line: 291)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Object, Array) (Line: 161)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object) (Line: 45)
Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object, 'kernel.response', Object) call_user_func(Array, Object, 'kernel.response', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.response', Object) (Line: 191)
Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 173)
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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

2
  • I got this from an incorrect path from an attach_library('was-wrong/libname') call in a twig file.
    – Cameron
    Aug 9, 2022 at 5:11
  • I had a similar error when trying to add or edit an image media. I cleared my browser caching and it helped. Can't explain why.
    – NicklasF
    Jun 1 at 10:58

4 Answers 4

1

Had same issue. Resolved with:

  • search THEME-NAME string in themes folder
  • remove reference to the useless theme

In my case, I was having

User warning: The following theme is missing from the file system: pxrflx in drupal_get_filename() 

This warning disappeard once I removed

libraries:
  - pxrflx/global-styling

from the a_differnt_theme_from_pxrflx.yml file

1
  • Thanks, this helped lead me to the apparent cause in my case, which wasn't a reference to the other theme in the *.info.yml or *.libraries.yml files, but related (references in templates to {{ attach_library('problem_theme/some_library') }}) Jun 27 at 19:06
1

This warning generally occurs if Drupal can't find the folder of the related module or theme. There is a manual page on how to get rid of this error: How to fix "The following module is missing from the file system..." warning messages.

Looking at the date of the question, there is a big chance this is happening because of version conflict between the Media entity module and source provider modules. If the installed version of the Media entity module is 1.x, then your core media module is not installed. If you are using the 2.x version of the media source provider modules like the Media entity video module or the Video Embed Field module, they are probably looking for the core Media module.

If you're building a new site, you should start over with the core Media module. If you're upgrading your existing site, you should follow the upgrade path. Instructions for both are given on the Media entity project page.

0

Another possibility to why this problem exists is when a module or theme is installed, but doesn't enable all the required dependencies it needs to operate. That's often what throws an error like this.

The error can be a bit confusing, since it lists a theme as missing, when the problem could lie with a missing or yet-to-be-enabled module.

In this particular case, you could probably run drush pm:enable media to resolve the issue.

-1

Used this reference https://www.drupal.org/node/2940438 and found the deprecated functions and this fixed the issue.

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jan 18 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.