Error: Object of class Drupal\Core\StringTranslation\TranslationManager could not be converted to string

Created on 26 July 2024, about 1 month ago

Problem/Motivation

I'm working in a local Drupal environment with Drupal 10.2.5 and the localhost website will not load. I use Lando and when I start the services, the NGINX URLS do not start. When I load the local site, I get a site unavailable error related to Search API.

The website encountered an unexpected error. Try again later.

Error: Object of class Drupal\Core\StringTranslation\TranslationManager could not be converted to string in Drupal\search_api\SearchApiPluginManager->alterDefinitions() (line 74 of modules/contrib/search_api/src/SearchApiPluginManager.php).

I will share the entire stack trace below. I searched the web for this error and came across some issues that seemed related. I tried to install the patches but composer would not allow it.

Versions:
Search API 1.x-1.35
Search API Solr 4.3.4

Steps to reproduce

Drupal 10.2.5 and the search modules above.

Stack Trace

The website encountered an unexpected error. Try again later.

Error: Object of class Drupal\Core\StringTranslation\TranslationManager could not be converted to string in Drupal\search_api\SearchApiPluginManager->alterDefinitions() (line 74 of modules/contrib/search_api/src/SearchApiPluginManager.php).
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 205)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 111)
Drupal\search_api\Utility\PluginHelper->createIndexPlugins() (Line: 158)
Drupal\search_api\Utility\PluginHelper->createProcessorPlugins() (Line: 535)
Drupal\search_api\Entity\Index->getProcessors() (Line: 551)
Drupal\search_api\Entity\Index->getProcessorsByStage() (Line: 844)
Drupal\search_api\Entity\Index->getPropertyDefinitions() (Line: 475)
Drupal\search_api\Item\Field->getDataDefinition() (Line: 206)
_search_api_views_get_handlers() (Line: 63)
search_api_views_data() (Line: 228)
Drupal\views\ViewsData->Drupal\views\{closure}() (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 236)
Drupal\views\ViewsData->getData() (Line: 151)
Drupal\views\ViewsData->get() (Line: 94)
Drupal\views\Plugin\Derivative\ViewsEntityRow->getDerivativeDefinitions() (Line: 101)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives() (Line: 87)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 323)
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 205)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 146)
views_theme() (Line: 479)
Drupal\Core\Theme\Registry->processExtension() (Line: 372)
Drupal\Core\Theme\Registry->Drupal\Core\Theme\{closure}() (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 373)
Drupal\Core\Theme\Registry->build() (Line: 255)
Drupal\Core\Theme\Registry->get() (Line: 88)
Drupal\Core\Utility\ThemeRegistry->initializeRegistry() (Line: 69)
Drupal\Core\Utility\ThemeRegistry->__construct() (Line: 291)
Drupal\Core\Theme\Registry->getRuntime() (Line: 193)
Drupal\Core\Entity\EntityViewBuilder->getBuildDefaults() (Line: 61)
Drupal\node\NodeViewBuilder->getBuildDefaults() (Line: 157)
Drupal\Core\Entity\EntityViewBuilder->viewMultiple() (Line: 123)
Drupal\Core\Entity\EntityViewBuilder->view() (Line: 134)
Drupal\Core\Entity\Controller\EntityViewController->view() (Line: 66)
Drupal\node\Controller\NodeViewController->view()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

πŸ› Bug report
Status

Closed: works as designed

Version

1.35

Component

General code

Created by

πŸ‡ΊπŸ‡ΈUnited States rraney

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rraney
  • πŸ‡ΊπŸ‡ΈUnited States rraney

    I determined that this is an issue with my SOLR container in my local environment. I removed the SOLR container locally and the site came up. Also, I deployed the site to a new branch and I don't see any issues. I attribute this problem to Docker/Lagoon/Lando and not this module.

  • Status changed to Closed: works as designed about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States rraney
Production build 0.71.5 2024