Commit 69f1e320 authored by Thomas Seiber's avatar Thomas Seiber
Browse files

Issue #3238635 by drunken monkey, mkalkbrenner: Deprecated...

Issue #3238635 by drunken monkey, mkalkbrenner: Deprecated AutocompleteBackendInterface in favor of the one in Search API.
parent dd3af8f5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
Search API Autocomplete 1.x, dev (xxxx-xx-xx):
----------------------------------------------
- #3238635 by drunken monkey, mkalkbrenner: Deprecated
  AutocompleteBackendInterface in favor of the one in Search API.
- #3224354 by drunken monkey: Fixed service container error after module
  upgrade.
- #3228452 by drunken monkey: Fixed test failures against Drupal 9.3.x.
+8 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

namespace Drupal\search_api_autocomplete;

@trigger_error('\Drupal\search_api_autocomplete\AutocompleteBackendInterface is deprecated in search_api_autocomplete:8.x-1.6 and is removed from search_api_autocomplete:2.0.0. Use \Drupal\search_api\Contrib\AutocompleteBackendInterface instead. See https://www.drupal.org/node/3256202.', E_USER_DEPRECATED);

use Drupal\search_api\Query\QueryInterface;
use Drupal\search_api\Backend\BackendInterface;

@@ -13,6 +15,12 @@ use Drupal\search_api\Backend\BackendInterface;
 *
 * Please note that this interface is purely documentational. You shouldn't, and
 * can't, implement it explicitly (unless your module is depending on this one).
 *
 * @deprecated in search_api_autocomplete:8.x-1.6 and is removed from
 *   search_api_autocomplete:2.0.0. Use
 *   \Drupal\search_api\Contrib\AutocompleteBackendInterface instead.
 *
 * @see https://www.drupal.org/node/3256202
 */
interface AutocompleteBackendInterface extends BackendInterface {

+5 −2
Original line number Diff line number Diff line
@@ -6,11 +6,12 @@ use Drupal\Component\Transliteration\TransliterationInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Plugin\PluginFormInterface;
use Drupal\search_api\Contrib\AutocompleteBackendInterface as NewAutocompleteBackendInterface;
use Drupal\search_api\IndexInterface;
use Drupal\search_api\Plugin\PluginFormTrait;
use Drupal\search_api\Query\QueryInterface;
use Drupal\search_api\SearchApiException;
use Drupal\search_api_autocomplete\AutocompleteBackendInterface;
use Drupal\search_api_autocomplete\AutocompleteBackendInterface as OldAutocompleteBackendInterface;
use Drupal\search_api_autocomplete\SearchInterface;
use Drupal\search_api_autocomplete\Suggester\SuggesterPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -199,7 +200,9 @@ class Server extends SuggesterPluginBase implements PluginFormInterface {
    catch (SearchApiException $e) {
      return NULL;
    }
    if ($server->supportsFeature('search_api_autocomplete') || $backend instanceof AutocompleteBackendInterface) {
    if ($server->supportsFeature('search_api_autocomplete')
        || $backend instanceof NewAutocompleteBackendInterface
        || $backend instanceof OldAutocompleteBackendInterface) {
      return $backend;
    }
    return NULL;