Commit fc1e1632 authored by git's avatar git Committed by Nikunj Kotecha
Browse files

Issue #3298002 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent 6a7fffb9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
  "extra": {
    "drush": {
      "services": {
        "drush.services.yml": "^9"
        "drush.services.yml": "^9 || ^10"
      }
    }
  }
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ use Drupal\search_api\IndexInterface;
 * @param \Drupal\search_api\Item\ItemInterface[] $items
 *   An array of items to be indexed, keyed by their item IDs.
 */
function hook_search_api_algolia_objects_alter(array &$objects, \Drupal\search_api\IndexInterface $index, array $items) {
function hook_search_api_algolia_objects_alter(array &$objects, IndexInterface $index, array $items) {
  // Adds a "foo" field with value "bar" to all documents.
  foreach ($objects as $key => $object) {
    $objects[$key]['foo'] = 'bar';
+1 −2
Original line number Diff line number Diff line
type: module
name: 'Algolia Search'
description: 'Provides integration with the Algolia search engine'
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^9.3 || ^10
package: Search
dependencies:
 - search_api:search_api
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ function search_api_algolia_form_search_api_index_edit_form_alter(&$form, FormSt

      $form['options']['algolia_index_list'] = [
        '#type' => 'item',
        '#markup' => render($element),
        '#markup' => \Drupal::service('renderer')->render($element),
        '#weight' => 3,
      ];
    }
+4 −2
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

namespace Drupal\search_api_algolia\Plugin\search_api\backend;

use Drupal\search_api_autocomplete\SearchInterface;
use Drupal\search_api_autocomplete\Suggestion\SuggestionFactory;
use Algolia\AlgoliaSearch\SearchClient;
use Algolia\AlgoliaSearch\Exceptions\AlgoliaException;
use Algolia\AlgoliaSearch\SearchIndex;
@@ -796,14 +798,14 @@ class SearchApiAlgoliaBackend extends BackendPluginBase implements PluginFormInt
   *
   * @see \Drupal\search_api_autocomplete\AutocompleteBackendInterface
   */
  public function getAutocompleteSuggestions(QueryInterface $query, \Drupal\search_api_autocomplete\SearchInterface $search, $incomplete_key, $user_input) {
  public function getAutocompleteSuggestions(QueryInterface $query, SearchInterface $search, $incomplete_key, $user_input) {
    // This function will be used only is search_api_autocomplete is enabled
    // and used. We have it here to add the support but it might never be used
    // in normal cases.
    $suggestions = [];

    try {
      $factory = new \Drupal\search_api_autocomplete\Suggestion\SuggestionFactory($user_input);
      $factory = new SuggestionFactory($user_input);
    }
    catch (\Exception $e) {
      return $suggestions;