Uncaught Error: Class "Drupal\search_api\Entity\Index" not found in facets.module:393

Created on 2 November 2023, about 1 year ago
Updated 9 March 2024, 10 months ago

Problem/Motivation

This might be more of an FYI / workaround report than a bug report, i don't know.

Attempting to deploy a whole bunch of changes worked out locally, including enabling Search API and Facets in the first place.

First attempt at deploying didn't work because a view added on live that i'd synced down relied on core search module, which i'd disabled. Enabled search locally (with the plan to refactor that view and disable it again), committed, and the merged configuration imports fine locally.

Then went to deploy, and got this errorβ€” tried a couple more times and still got it. Tried enabling Search API manually on the deployment target site, and then deploying, and that fixed it, everything imported fine.

Is Facets actually dependent on Search API or should this alter hook have some checks?

PHP Fatal error: Uncaught Error: Class "Drupal\search_api\Entity\Index" not found in /home/housing_data_test/site/web/modules/contrib/facets/facets.module:393
Stack trace:
#0 /home/housing_data_test/site/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(545): facets_views_data_alter()
#1 /home/housing_data_test/site/web/core/modules/views/src/ViewsData.php(245): Drupal\Core\Extension\ModuleHandler->alter()
#2 /home/housing_data_test/site/web/core/modules/views/src/ViewsData.php(154): Drupal\views\ViewsData->getData()
#3 /home/housing_data_test/site/web/modules/contrib/ds/src/Plugin/Derivative/DsEntityRow.php(91): Drupal\views\ViewsData->get()
#4 /home/housing_data_test/site/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\ds\Plugin\Derivative\DsEntityRow->getDerivativeDefinitions()
#5 /home/housing_data_test/site/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives()
#6 /home/housing_data_test/site/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(291): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#7 /home/housing_data_test/site/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(181): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#8 /home/housing_data_test/site/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#9 /home/housing_data_test/site/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(16): Drupal\Core\Plugin\DefaultPluginManager->getDefinition()
#10 /home/housing_data_test/site/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance()
#11 /home/housing_data_test/site/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(828): Drupal\Component\Plugin\PluginManagerBase->createInstance()
#12 /home/housing_data_test/site/web/core/modules/views/src/Plugin/views/style/StylePluginBase.php(131): Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin()
#13 /home/housing_data_test/site/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(831): Drupal\views\Plugin\views\style\StylePluginBase->init()
#14 /home/housing_data_test/site/web/core/modules/rest/src/Plugin/views/display/RestExport.php(346): Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin()
#15 /home/housing_data_test/site/web/core/modules/views/src/EventSubscriber/RouteSubscriber.php(120): Drupal\rest\Plugin\views\display\RestExport->collectRoutes()
#16 [internal function]: Drupal\views\EventSubscriber\RouteSubscriber->routes()

πŸ› Bug report
Status

Closed: won't fix

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

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

Comments & Activities

  • Issue created by @mlncn
  • πŸ‡«πŸ‡·France erwangel

    I think this is a dependency declaration or a dependency issue. I had the same problem while trying to install fancy_file_delete module which has a dependency to views_bulk_operations. Facets module had been installed and enabled just before. I didn't explore further as I did'nt have timefor this and fancy_file_delete is not essential for what I'm doing, so I gave it up without installing the module.

    $ composer require 'drupal/fancy_file_delete:^2.0'
    ./composer.json has been updated
    Running composer update drupal/fancy_file_delete
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 2 installs, 0 updates, 0 removals
      - Locking drupal/fancy_file_delete (2.0.9)
      - Locking drupal/views_bulk_operations (4.2.5)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 2 installs, 0 updates, 0 removals
      - Installing drupal/views_bulk_operations (4.2.5): Extracting archive
      - Installing drupal/fancy_file_delete (2.0.9): Extracting archive
    Generating autoload files
    48 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    No security vulnerability advisories found.
    $ drush en fancy_file_delete
    The following module(s) will be enabled: fancy_file_delete, views_bulk_operations
    
     Do you want to continue? (yes/no) [yes]:
     > yes
    
     [error]  Error: Class "Drupal\search_api\Entity\Index" not found in facets_views_data_alter() (line 393 of /home/athan/domains/aktigram.com/public_html/aktigram/igr_10/web/modules/contrib/facets/facets.module) #0 /home/athan/domains/aktigram.com/public_html/aktigram/igr_10/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(545): facets_views_data_alter()
    #1 /home/athan/domains/aktigram.com/public_html/aktigram/igr_10/web/core/modules/views/src/ViewsData.php(245): Drupal\Core\Extension\ModuleHandler->alter()
    #2 /home/athan/domains/aktigram.com/public_html/aktigram/igr_10/web/core/modules/views/src/ViewsData.php(154): Drupal\views\ViewsData->getData()
    ... etc
    
  • πŸ‡«πŸ‡·France erwangel

    In complement of my previous comment, I could not install any other module (at least feeds which was the next in my list) without having the same problem while enabling the module. I had to uninstall "facets" then I could enable the other modules without the errors above.

  • Status changed to Needs review 10 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 10 months ago
    Patch Failed to Apply
  • πŸ‡­πŸ‡ΊHungary gdeni Budapest

    I am attaching a hotfix for version 3.0.0-beta1.

    Version 3.0.x-dev no longer includes the problematic hook, and seearch_api has been added to the dependencies. See the commit here.

  • Status changed to Closed: won't fix 10 months ago
  • πŸ‡§πŸ‡ͺBelgium borisson_ Mechelen, πŸ‡§πŸ‡ͺ

    Closing as won't fix, since it's already been fixed in the module itself. We have a hard dependency on Search API now.

Production build 0.71.5 2024