Closed (fixed)
Project:
MerlinOne
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2018 at 17:58 UTC
Updated:
11 Apr 2018 at 13:23 UTC
Jump to comment: Most recent
When attempting to add a MerlinOne Search widget to an Entity Browser, no widgets appear in the list and the following error is thrown:
TypeError: Argument 12 passed to Drupal\merlinone\Plugin\EntityBrowser\Widget\MerlinOneSearch::__construct() must be an instance of Drupal\Core\File\MimeType\MimeTypeGuesser, instance of Drupal\Core\ProxyClass\File\MimeType\MimeTypeGuesser given, called in /mnt/www/html/pihoe8qdqkkucy/docroot/modules/contrib/merlinone/src/Plugin/EntityBrowser/Widget/MerlinOneSearch.php on line 128 in Drupal\merlinone\Plugin\EntityBrowser\Widget\MerlinOneSearch->__construct() (line 102 of /mnt/www/html/pihoe8qdqkkucy/docroot/modules/contrib/merlinone/src/Plugin/EntityBrowser/Widget/MerlinOneSearch.php) #0 /mnt/www/html/pihoe8qdqkkucy/docroot/modules/contrib/merlinone/src/Plugin/EntityBrowser/Widget/MerlinOneSearch.php(128): Drupal\merlinone\Plugin\EntityBrowser\Widget\MerlinOneSearch->__construct(Array, 'merlinone_searc...', Array, Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher), Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\entity_browser\WidgetValidationManager), Object(Drupal\Core\Session\AccountProxy), Object(Drupal\Core\File\FileSystem), Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\token\Token), Object(GuzzleHttp\Client), Object(Drupal\Core\ProxyClass\File\MimeType\MimeTypeGuesser)) #1 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\merlinone\Plugin\EntityBrowser\Widget\MerlinOneSearch::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'merlinone_searc...', Array) #2 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(84): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('merlinone_searc...', Array) #3 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(81): Drupal\Component\Plugin\PluginManagerBase->createInstance('merlinone_searc...', Array) #4 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('ed29f11e-f563-4...') #5 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(160): Drupal\Component\Plugin\LazyPluginCollection->get('ed29f11e-f563-4...') #6 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(172): Drupal\Core\Plugin\DefaultLazyPluginCollection->setInstanceConfiguration('ed29f11e-f563-4...', Array) #7 /mnt/www/html/pihoe8qdqkkucy/docroot/modules/contrib/entity_browser/src/Entity/EntityBrowser.php(288): Drupal\Core\Plugin\DefaultLazyPluginCollection->addInstanceId('ed29f11e-f563-4...', Array) #8 /mnt/www/html/pihoe8qdqkkucy/docroot/modules/contrib/entity_browser/src/Form/WidgetsConfig.php(160): Drupal\entity_browser\Entity\EntityBrowser->addWidget(Array) #9 [internal function]: Drupal\entity_browser\Form\WidgetsConfig::submitAddWidget(Array, Object(Drupal\Core\Form\FormState)) #10 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Form/FormSubmitter.php(111): call_user_func_array(Array, Array) #11 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState)) #12 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(585): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) #13 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(314): Drupal\Core\Form\FormBuilder->processForm('entity_browser_...', Array, Object(Drupal\Core\Form\FormState)) #14 /mnt/www/html/pihoe8qdqkkucy/docroot/modules/contrib/ctools/src/Wizard/WizardFactory.php(41): Drupal\Core\Form\FormBuilder->buildForm('entity_browser_...', Object(Drupal\Core\Form\FormState)) #15 /mnt/www/html/pihoe8qdqkkucy/docroot/modules/contrib/ctools/src/Controller/WizardFormController.php(79): Drupal\ctools\Wizard\WizardFactory->getWizardForm(Object(Drupal\entity_browser\Wizard\EntityBrowserWizard), Array, false) #16 [internal function]: Drupal\ctools\Controller\WizardFormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #17 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #18 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #19 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #20 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #21 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #22 /mnt/www/html/pihoe8qdqkkucy/docroot/vendor/symfony/http-kernel/HttpKernel.php(153): call_user_func_array(Object(Closure), Array) #23 /mnt/www/html/pihoe8qdqkkucy/docroot/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #24 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /mnt/www/html/pihoe8qdqkkucy/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 /mnt/www/html/pihoe8qdqkkucy/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #28 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #29 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #30 /mnt/www/html/pihoe8qdqkkucy/docroot/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #31 /mnt/www/html/pihoe8qdqkkucy/docroot/core/lib/Drupal/Core/DrupalKernel.php(657): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #32 /mnt/www/html/pihoe8qdqkkucy/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #33 {main}.
Comments
Comment #2
karlsheaWe're currently not compatible with media in core, but it's on the roadmap and we'll be releasing a 2.x branch that is.
Comment #3
adambernstein commentedGood to know, thank you @KarlShea!
Comment #4
karlsheaSure thing! I'll update this issue when we have a 2.x branch ready. Just to be clear though, this module should function in 8.4/8.5 as long as core media isn't enabled and the contrib modules are targeting media contrib (usually their 1.x branches).
Comment #5
adambernstein commentedJust FYI, I'm actually getting this same error with core Media disabled (using Media Entity 8.x-1.7 and Entity Browser 8.x-1.4) on MerlinOne 8.x-1.0+6-dev.
MerlinOne 8.x-1.0 seems to work as expected with no errors.
Comment #6
karlsheaSure enough, although it never came up during development or testing (which is strange) it looks like I should have been using the MimeTypeGuesserInterface instead of MimeTypeGuesser. Does the dev release I just pushed up fix the issue for you?
Comment #7
adambernstein commentedConfirming the latest version 8.x-1.0+7-dev appears to eliminate the error, thanks Karl!
Comment #8
karlsheaAwesome, glad it's working!
Comment #10
karlsheaFYI there's a 2.x branch now if you'd like to test it with core media, just make sure you follow the upgrade path here.
Comment #11
adambernstein commentedAwesome, thanks for the update! Will try it out as soon as we can.