Upgrade to 1.30 throws

Too few arguments to function Drupal\search_api\Utility\FieldsHelper::__construct(), 4 passed in . . . /public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 5 expected in Drupal\search_api\Utility\FieldsHelper->__construct() (line 87 of modules/search_api/src/Utility/FieldsHelper.php).

Comments

bobburns created an issue. See original summary.

bobburns’s picture

Issue summary: View changes
joinso’s picture

Same error here.
Rollback to 1.29

bsingh’s picture

Same error!

grzesag’s picture

I upgraded from 1.29 to 1.30 on Drupal 10.1.5 and looks good to me

are you seeing this for Drupal 10.1.5? where do you see this error? Settings or when searching?

Thanks

bwong’s picture

Same issue on Drupal 9.5.11. Moved back to 1.28

geoffray’s picture

Same issue after upgrading from v1.28 / Drupal 9.4.15 to v1.30 / Drupal 9.5.11

bobburns’s picture

Issue summary: View changes
bobburns’s picture

ISSUE FOUND - ADD

use Drupal\search_api\Utility\DataTypeHelperInterface;
use Drupal\search_api\Utility\ThemeSwitcherInterface;

to top of modules/search_api/src/Utility/FieldsHelper.php

BUT . . .

The errors in the 2 Upgrade Status JPG snip shot uploads need address and added to a new release along with the fix above

bobburns’s picture

StatusFileSize
new172.99 KB
new128.04 KB

Search api errors from Upgrade Status - coding deeper than I want to go to fix

bobburns’s picture

Issue summary: View changes
drunken monkey’s picture

Version: 8.x-1.30 » 8.x-1.x-dev
Component: General code » Framework
Issue summary: View changes
Status: Active » Needs review
Parent issue: » #3320841: TextProcessed theme different between PostRequestIndexing/UI indexing and Drush indexing
StatusFileSize
new1.5 KB

You’re right, thanks a lot for reporting!
Forgot again that we cannot just change the constructor parameters of services …
Proper way is a deprecation – patch attached and change record created. Please test/review!
I’ll create a 1.31 release right away after committing this.

niki v’s picture

I just ran into this error after doing some upgrades on a local d10 site. I can confirm that the patch solved it

chris64’s picture

  • drunken monkey committed 45a96186 on 8.x-1.x
    Issue #3394738 by drunken monkey: Fixed fatal error after upgrade to 1....
drunken monkey’s picture

Status: Needs review » Fixed

Thanks for reporting back, good to hear it worked.
Merged.

(Since #3388678: Performance issues after fixing 'PHP 8.1 preg_replace()' issue is also a regression, though, I think I’m gonna wait for that until creating a new release.)

Status: Fixed » Closed (fixed)

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

ronraney’s picture

I just used this patch in #12 because I was seeing the error for search_api version ^1.30.

After the patch is installed using composer, now I'm seeing this:

The website encountered an unexpected error. Please try again later.

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "search_api.theme_switcher". in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal::service() (Line: 97)
Drupal\search_api\Utility\FieldsHelper->__construct() (Line: 259)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 267)
Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::create() (Line: 21)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 83)
Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 149)
Drupal\search_api\Entity\Server->getBackend() (Line: 198)
Drupal\search_api\Entity\Server->isAvailable() (Line: 93)
search_api_requirements()
call_user_func_array() (Line: 426)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 433)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 109)
Drupal\system\SystemManager->listRequirements() (Line: 93)
Drupal\system\SystemManager->checkRequirements() (Line: 124)
Drupal\system\Controller\SystemController->overview()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->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: 23)
Stack\StackedHttpKernel->handle() (Line: 718)
Drupal\Core\DrupalKernel->handle() (Line: 19)