Problem/Motivation

Tried enabling the 1.x-dev version of this module (http://cgit.drupalcode.org/acquia_search_multi_subs/commit/?id=a8e82af) but ran into some errors.

Since I already had Acquia Search enabled, I had a Server and search index automatically setup.

On /admin/config/search/search-api/server/acquia_search_server/edit, when switching to "Acquia Solr Multi Sub" for the Backend of the existing "Acquia Search API Solr server”, there was an Ajax error.

I found out that this error is originating from this line:
$this->backendPlugin = $backend_plugin_manager->createInstance($this->getBackendId()

in Server::getBackend() in Drupal\search_api\Entity\Server.php

I found the following information about the error:

Drupal\Component\Plugin\Exception\PluginException: Plugin (search_api_solr_acquia_multi_subs) instance class "Drupal\acquia_search_multi_subs\Plugin\search_api\backend\SearchApiSolrAcquiaMultiSubsBackend" does not exist. in /var/www/build/html/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php on line <i>102</i>

It looks like when trying to create an instance of the Plugin, class_exists("Drupal\acquia_search_multi_subs\Plugin\search_api\backend\SearchApiSolrAcquiaMultiSubsBackend") is returning false in DefaultFactory::getPluginClass() .(Drupal\Component\Plugin\Factory\DefaultFactory.php)

Also related:

I removed the following use lines from SearchApiSolrAcquiaMultiSubsBackend.php since they did not appear to be used:

use Drupal\acquia_connector\Client;
use Drupal\acquia_connector\CryptConnector;
use Symfony\Component\Validator\Constraints\False;

Symfony\Component\Validator\Constraints\False in particular was causing the following fatal error:

PHP Fatal error:  Cannot use Symfony\Component\Validator\Constraints\False as False because 'False' is a special class name in /var/www/build/html/modules/contrib/acquia_search_multi_subs/src/Plugin/search_api/backend/SearchApiSolrAcquiaMultiSubsBackend.php on line 15"

When creating a new Server with the "Acquia Solr Multi Sub" Backend selected, save results in another fatal error:

PHP Fatal error:  Class 'Solarium\Core\Plugin\AbstractPlugin' not found in /var/www/build/html/modules/contrib/acquia_search_multi_subs/src/EventSubscriber/SearchSubscriber.php on line 12"

This problem is different as it appears that the error is coming from attempting to create a new SearchSubscriber() in SearchApiSolrAcquiaMultiSubsBackend::connect()

Comments

mirie created an issue. See original summary.

mirie’s picture

Priority: Normal » Major
Issue summary: View changes
snufkin’s picture

What version of search api and search api solr and Solr version have you tested with?

mirie’s picture

Hi snufkin,

I had the following.

I'm testing next with:

  • Search API: - 1.0-alpha13
  • Search API Solr: 1.x.-dev
jhedstrom’s picture

Priority: Major » Normal
Issue summary: View changes

Running the latest dev release of both search_api and search_api_solr, I get a different error when editing a server to move it to multi-subs:

Fatal error: Class 'Solarium\Core\Plugin\AbstractPlugin' not found in modules/acquia_search_multi_subs/src/EventSubscriber/SearchSubscriber.php on line 12
jhedstrom’s picture

Priority: Normal » Major

Didn't mean to change priority.

mirie’s picture

Issue summary: View changes

I don't know why yesterday's revision of the issue summary disappeared. Re-updating.

mirie’s picture

Confirmed that with:

- Search API: 1.0-alpha13
- Search API Solr: 1.x.-dev

after removing the use Symfony\Component\Validator\Constraints\False; line in SearchApiSolrAcquiaMultiSubsBackend.php, I still get the error

PHP Fatal error: Class 'Solarium\Core\Plugin\AbstractPlugin' not found in /var/www/build/html/modules/contrib/acquia_search_multi_subs/src/EventSubscriber/SearchSubscriber.php on line 12"

when attempting to save a new solr server. Similarly get an Ajax error when trying to switch the backend for an existing Acquia search server configuration.

snufkin’s picture

Hmm what version of solarium are you using? If this is an issue with the library compatibility, then it will be a problem with Acquia Search as well since that is also extending this class.

mirie’s picture

Using: solarium/solarium:3.4.1 -- the version listed in the composer.json in search_api_solr

mpp’s picture