Druapl 9.5.4. PHP 8.1.

TypeError: Drupal\sharethis\SharethisManager::__construct(): Argument #5 ($entity_type_manager) must be of type Drupal\Core\Entity\EntityTypeManagerInterface, Drupal\Core\Extension\ModuleHandler given, called in /mnt/wsl/PHYSICALDRIVE0p1/www/unctad/target/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\sharethis\SharethisManager->__construct() (line 84 of /mnt/wsl/PHYSICALDRIVE0p1/www/unctad/target/web/modules/contrib/sharethis/src/SharethisManager.php)

I get this on all sites upgraded to sharethis 3.0.1. Had to downgrade to 8.x-2.0 and all is well

CommentFileSizeAuthor
#2 3345692-2.patch523 bytesadil_siddiqui

Comments

webfaqtory created an issue. See original summary.

adil_siddiqui’s picture

Status: Active » Needs review
StatusFileSize
new523 bytes

Patch created

dadderley’s picture

Same problem with me.
Upgrading from 8.x-2.0 to 3.0.1 results in WSOD

This is on a Drupal 9.5.4 installation running in PHP 8.1.16

I upgraded ShareThis from 8.x-2.0 to 3.0.1 using composer.
There were no composer errors.

Running the Drush updb command produced no errors.

public_html# drush updb
[success] No pending updates.

public_html# drush cr
[success] Cache rebuild complete.

When I went to site pages where the ShareThis widget is enabled I get a WSOD.

I rolled back the module to 8.x-2.0.
The site is back.

On the dblog page I see this error.

Message	TypeError: Drupal\sharethis\SharethisManager::__construct(): Argument #5 ($entity_type_manager) must be of type Drupal\Core\Entity\EntityTypeManagerInterface, Drupal\Core\Extension\ModuleHandler given, called in /home/mysite/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\sharethis\SharethisManager->__construct() (line 84 of /home/mysite/public_html/modules/contrib/sharethis/src/SharethisManager.php)
#0 /home/mysite/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\sharethis\SharethisManager->__construct()
#1 /home/mysite/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
#2 /home/mysite/public_html/core/lib/Drupal.php(197): Drupal\Component\DependencyInjection\Container->get()
#3 /home/mysite/public_html/modules/contrib/sharethis/sharethis.module(81): Drupal::service()
#4 [internal function]: sharethis_node_view()
#5 /home/mysite/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array()
#6 /home/mysite/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
#7 /home/mysite/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#8 /home/mysite/public_html/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(288): Drupal\Core\Extension\ModuleHandler->invokeAll()
#9 /home/mysite/public_html/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(239): Drupal\Core\Entity\EntityViewBuilder->buildMultiple()
#10 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build()
#11 /home/mysite/public_html/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
#12 /home/mysite/public_html/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
#13 /home/mysite/public_html/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
#14 /home/mysite/public_html/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#15 /home/mysite/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->render()
#16 /home/mysite/public_html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#17 /home/mysite/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(243): Drupal\Core\Render\Renderer->executeInRenderContext()
#18 /home/mysite/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#19 /home/mysite/public_html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#20 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#21 /home/mysite/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#22 /home/mysite/public_html/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#23 /home/mysite/public_html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#24 /home/mysite/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#25 /home/mysite/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#26 /home/mysite/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#27 /home/mysite/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch()
#28 /home/mysite/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup()
#29 /home/mysite/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#30 /home/mysite/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#31 /home/mysite/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#32 /home/mysite/public_html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#33 /home/mysite/public_html/index.php(19): Drupal\Core\DrupalKernel->handle()
#34 {main}
rclemings’s picture

Similar but not identical error; I'll file it as a comment here rather than opening a new issue because they seem related:

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\sharethis\SharethisManager::__construct(): Argument #5 ($entity_type_manager) must be of type Drupal\Core\Entity\EntityTypeManagerInterface, Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given, called in /home/nine/domains/xxxx.xxxx.xxx/public_html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\sharethis\SharethisManager->__construct() (line 84 of modules/contrib/sharethis/src/SharethisManager.php). 
vladimiraus’s picture

Status: Needs review » Needs work

Good catch! Another issue I found is

TypeError: Illegal offset type in Drupal\sharethis\SharethisManager->getOptions() (line 104 of modules/contrib/sharethis/src/SharethisManager.php).

vladimiraus’s picture

Status: Needs work » Fixed

Thanks, everyone! Committed! 🍻

rclemings’s picture

Works fine now, as far as I can tell. Thanks. I'm also having an issue with the config page but I will file a new issue on that.

pmkanse’s picture

vladimiraus’s picture

vladimiraus’s picture

Thanks @pmkanse. 🥂
I closed the other tasks and gave you credit here.

dadderley’s picture

I just installed ShareThis 3.0.2 snd it works well.
No errors, thanks.

Status: Fixed » Closed (fixed)

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