Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I updated from 4.0-beta2 to beta4 with drush and I get an error which crashes my site.
I had to downgrade back to beta2 to fix the problem.
PHP Version 7.2.22
Database Version 5.7.26
System MySQL, MariaDB, Percona Server, or equivalent
TypeError: Argument 1 passed to Drupal\context\ContextManager::__construct() must be an instance of Drupal\Core\Entity\Query\QueryFactory, instance of Drupal\Core\Entity\EntityTypeManager given, called in .../core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\context\ContextManager->__construct() (line 92 of .../modules/context/src/ContextManager.php)
#0 .../core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\context\ContextManager->__construct(Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\Plugin\Context\LazyContextRepository), Object(Drupal\Core\Plugin\Context\ContextHandler), Object(Drupal\Core\Entity\EntityFormBuilder), Object(Drupal\Core\Theme\ThemeManager))
#1 .../core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'context.manager')
#2 .../core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get('context.manager', 1)
#3 .../core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#4 .../core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'theme.negotiato...')
#5 .../core/lib/Drupal/Core/DependencyInjection/ClassResolver.php(20): Drupal\Component\DependencyInjection\Container->get('theme.negotiato...')
#6 .../core/lib/Drupal/Core/Theme/ThemeNegotiator.php(65): Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('theme.negotiato...')
#7 .../core/lib/Drupal/Core/Theme/ThemeManager.php(405): Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object(Drupal\Core\Routing\RouteMatch))
#8 .../core/lib/Drupal/Core/Theme/ThemeManager.php(96): Drupal\Core\Theme\ThemeManager->initTheme(Object(Drupal\Core\Routing\RouteMatch))
#9 .../core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php(56): Drupal\Core\Theme\ThemeManager->getActiveTheme()
#10 .../core/lib/Drupal/Core/Cache/CacheCollector.php(340): Drupal\Core\Asset\LibraryDiscoveryCollector->getCid()
#11 .../core/lib/Drupal/Core/Cache/CacheCollector.php(144): Drupal\Core\Cache\CacheCollector->lazyLoadCache()
#12 .../core/lib/Drupal/Core/Asset/LibraryDiscovery.php(44): Drupal\Core\Cache\CacheCollector->get('audiofield')
#13 .../core/lib/Drupal/Core/Asset/LibraryDiscovery.php(58): Drupal\Core\Asset\LibraryDiscovery->getLibrariesByExtension('audiofield')
#14 .../modules/audiofield/src/AudioFieldPluginBase.php(133): Drupal\Core\Asset\LibraryDiscovery->getLibraryByName('audiofield', 'audiofield.audi...')
#15 .../modules/audiofield/audiofield.install(53): Drupal\audiofield\AudioFieldPluginBase->getPluginLibrary()
#16 [internal function]: audiofield_requirements('runtime')
#17 .../core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array('audiofield_requ...', Array)
#18 .../core/modules/system/src/SystemManager.php(111): Drupal\Core\Extension\ModuleHandler->invokeAll('requirements', Array)
#19 .../core/modules/system/src/Controller/SystemInfoController.php(49): Drupal\system\SystemManager->listRequirements()
#20 [internal function]: Drupal\system\Controller\SystemInfoController->status()
#21 .../core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#22 .../core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#23 .../core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#24 .../core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#25 .../vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#26 .../vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#27 .../core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 .../core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 .../core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 .../core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 .../core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 .../core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 .../vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 .../core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 .../index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#36 {main}
Thanks in advance for your help.
Comment | File | Size | Author |
---|---|---|---|
#6 | 3171217-6.patch | 226 bytes | paulocs |
Comments
Comment #2
paulocsHello @paolo m,
After you updated the module, did you clear you cache?
This is happening because the context manager service was changed since the last 4.0-beta2 release.
Cheers, Paulo.
Comment #3
paolo m. CreditAttribution: paolo m. commentedHello Paulo,
thank you very much for your reply.
I couldn't clear the cache because after the beta4 update drush wasn't working anymore.
I tried to execute the drush cr command but I got an error, and the site was broken.
Best regards. Paolo
Comment #4
paulocsCan you tell me the error when you run drush cr, please?
Comment #5
paolo m. CreditAttribution: paolo m. commentedHello Paulo,
thanks for your reply.
I tried to recreate the problem but this time I could successfully update context to beta4 because I could execute the drush cr command.
1) I executed drush up context and I got the "TypeError: Argument 1..." error.
2) I successfully executed the drush cr command.
3) I tried to update the db though the site and I got an error ("The update process was aborted prematurely while running update #8003 in context.module. All errors have been logged. You may need to check the watchdog database table manually").
4) I successfully executed the drush updatedb command, and now everything is OK.
I apologize for having opened this issue: when I saw that the site was broken and drush wasn't working anymore I thought I had no other choice.
I'm not an expert Drupal user but I know that many problems can be solved rebuilding the site cache.
Context is a module of vital importance for my site.
I thank you very much once again for your help and you patience.
Best regards. Paolo
Comment #6
paulocsNo problem.
I created a patch to fix the problem.
It will not be necessary to clear the cache because the patch will do it.
If it fixes the problem, I will create a new release.
Cheers, Paulo.
Comment #8
paulocsComment #9
paolo m. CreditAttribution: paolo m. commentedHello Paulo,
once again, thank you very much. Best regards. Paolo
Comment #11
paulocsCredit Ralph Manis for testing.
Comment #13
paulocsFixed in dev branch!
Thanks!