Upgrade to 1.30 throws helper too few arguements error

Created on 18 October 2023, 12 months ago
Updated 13 November 2023, 11 months ago

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).

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Framework

Created by

πŸ‡ΊπŸ‡ΈUnited States bobburns

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

Comments & Activities

  • Issue created by @bobburns
  • πŸ‡ΊπŸ‡ΈUnited States bobburns
  • πŸ‡ͺπŸ‡ΈSpain JOINSO Sabadell

    Same error here.
    Rollback to 1.29

  • πŸ‡¬πŸ‡§United Kingdom grzesag

    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

  • πŸ‡ΊπŸ‡ΈUnited States bwong

    Same issue on Drupal 9.5.11. Moved back to 1.28

  • πŸ‡§πŸ‡ͺBelgium geoffray

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

  • πŸ‡ΊπŸ‡ΈUnited States bobburns
  • πŸ‡ΊπŸ‡ΈUnited States bobburns

    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

  • πŸ‡ΊπŸ‡ΈUnited States bobburns

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

  • πŸ‡ΊπŸ‡ΈUnited States bobburns
  • Status changed to Needs review 11 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & sqlite-3.27
    last update 11 months ago
    545 pass
  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

    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.

  • πŸ‡ΏπŸ‡¦South Africa niki v

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

  • πŸ‡«πŸ‡·France Chris64 France

    Same main error message in πŸ› Search_api error from drush errp. Closed: works as designed

  • Status changed to Fixed 11 months ago
  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

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

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

  • Status changed to Fixed 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rraney

    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)
Production build 0.71.5 2024