Problem/Motivation
Error with Drupal 9.59
Deprecated function: fnmatch(): Passing null to parameter #1 ($pattern) of type string is deprecated in file_entity_match_mimetypes() (line 363 of /html/modules/file_entity/file_entity.module)
#0 /html/core/includes/bootstrap.inc(347): _drupal_error_handler_real(8192, '...', '...', 363)
#1 [internal function]: _drupal_error_handler(8192, '...', '...', 363)
#2 /html/modules/file_entity/file_entity.module(363): fnmatch(NULL, '...')
#3 /html/modules/file_entity/file_entity.file.inc(17): file_entity_match_mimetypes(Array, Array)
#4 [internal function]: file_entity_file_type(Object(Drupal\file_entity\Entity\FileEntity))
#5 /html/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#6 /html/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), '...')
#7 /html/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('...', Object(Closure))
#8 /html/modules/file_entity/src/Entity/FileEntity.php(487): Drupal\Core\Extension\ModuleHandler->invokeAll('...', Array)
#9 /html/modules/file_entity/src/Entity/FileEntity.php(312): Drupal\file_entity\Entity\FileEntity->determineType()
#10 /html/modules/file_entity/src/Entity/FileEntity.php(130): Drupal\file_entity\Entity\FileEntity->updateBundle()
#11 /html/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(97): Drupal\file_entity\Entity\FileEntity->postCreate(Object(Drupal\file\FileStorage))
#12 /html/core/lib/Drupal/Core/Entity/ContentEntityBase.php(1143): Drupal\Core\Entity\ContentEntityStorageBase->create(Array)
#13 /html/core/modules/ckeditor5/src/Controller/CKEditor5ImageController.php(171): Drupal\Core\Entity\ContentEntityBase::create(Array)
#14 [internal function]: Drupal\ckeditor5\Controller\CKEditor5ImageController->upload(Object(Symfony\Component\HttpFoundation\Request))
#15 /html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#16 /html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#17 /html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#19 /html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#20 /html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#21 /html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /html/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#31 {main}
Steps to reproduce
Proposed resolution
The error message you provided indicates that there is a deprecated function call in the file_entity.module file of your Drupal installation. The function fnmatch() is being called with a null value for the first parameter ($pattern), which is deprecated and no longer supported.
The deprecated function call is triggering a warning (error code 8192) in the Drupal error handling system. The error is logged in the bootstrap.inc file and eventually caught by the _drupal_error_handler() function in the same file.
Here is a breakdown of the stack trace:
The error is triggered on line 363 of the file_entity.module file.
The error handler function in bootstrap.inc is called with the error details.
The _drupal_error_handler() function logs the error.
The fnmatch() function in file_entity.module is called with a null value for the $pattern parameter.
The file_entity_match_mimetypes() function on line 363 of file_entity.module calls fnmatch().
This issue may cause problems in the functionality of the File Entity module or related modules that rely on it. To resolve the issue, you'll need to update the code in the file_entity.module file to use the correct parameter values for the fnmatch() function. The deprecated usage should be replaced with the updated syntax or a different function altogether, depending on your specific use case and the requirements of the module.