Unverified Commit 0536f0d2 authored by Nikolay Lobachev's avatar Nikolay Lobachev Committed by GitHub
Browse files

3289525 automated drupal 10 (#82)

* Issue #3289525: Update deprecated code. Refactor SearchApiSolrBackend to load services with DI. Clean up unused vars.

* Issue #3289525: Add latest suggestions from Drupal bot.

* Issue #3289525: Pass parameters to controller.

* Issue #3289525: Add necessary use statements.

* Issue #3289525: Pass module extension list service to controller.

* Issue #3289525: Replace the path to module to search_api_solr_legacy.

* Issue #3289525: Add missing paramters to SolrAdminCommandHelper constructor.

* Issue #3289525: Add module_extension_list to SearchApiSolrDevelCommands constructor.

* Issue #3289525: Revert ProphecyTrait, it was added by IDE.

* Issue #3289525: Update SearchApiSolrBackend test.
parent 60530ff9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,4 +13,4 @@ services:

  search_api_solr_admin.command_helper:
    class: Drupal\search_api_solr_admin\Utility\SolrAdminCommandHelper
    arguments: ['@entity_type.manager', '@module_handler', '@event_dispatcher', '@file_system', '@messenger']
    arguments: ['@entity_type.manager', '@module_handler', '@event_dispatcher', '@extension.list.module', '@file_system', '@messenger']
+5 −2
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Drupal\search_api_solr_admin\Utility;

use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Messenger\MessengerInterface;
@@ -43,6 +44,8 @@ class SolrAdminCommandHelper extends SolrCommandHelper {
   *   The file system.
   * @param \Drupal\Core\Messenger\MessengerInterface $messenger
   *   The messenger.
   * @param \Drupal\Core\Extension\ModuleExtensionList $module_extension_list
   *   The module extension list.
   *
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
   *   Thrown if the "search_api_index" or "search_api_server" entity types'
@@ -51,8 +54,8 @@ class SolrAdminCommandHelper extends SolrCommandHelper {
   *   Thrown if the "search_api_index" or "search_api_server" entity types are
   *   unknown.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, EventDispatcherInterface $event_dispatcher, FileSystemInterface $fileSystem, MessengerInterface $messenger) {
    parent::__construct($entity_type_manager, $module_handler, $event_dispatcher);
  public function __construct(EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, EventDispatcherInterface $event_dispatcher, ModuleExtensionList $module_extension_list, FileSystemInterface $fileSystem, MessengerInterface $messenger) {
    parent::__construct($entity_type_manager, $module_handler, $event_dispatcher, $module_extension_list);
    $this->fileSystem = $fileSystem;
    $this->messenger = $messenger;
  }
+1 −0
Original line number Diff line number Diff line
@@ -5,5 +5,6 @@ services:
      - '@entity_type.manager'
      - '@module_handler'
      - '@event_dispatcher'
      - '@extension.list.module'
    tags:
      - { name: drush.command }
+5 −2
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Drupal\search_api_solr_devel\Commands;

use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\search_api\SearchApiException;
use Drupal\search_api_solr\SearchApiSolrException;
@@ -33,13 +34,15 @@ class SearchApiSolrDevelCommands extends DrushCommands {
   *   The module handler.
   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
   *   The event dispatcher.
   * @param \Drupal\Core\Extension\ModuleExtensionList $module_extension_list
   *   The module extension list.
   *
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
   * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
   */
  public function __construct(EntityTypeManagerInterface $entityTypeManager, ModuleHandlerInterface $moduleHandler, EventDispatcherInterface $eventDispatcher) {
  public function __construct(EntityTypeManagerInterface $entityTypeManager, ModuleHandlerInterface $moduleHandler, EventDispatcherInterface $eventDispatcher, ModuleExtensionList $module_extension_list) {
    parent::__construct();
    $this->commandHelper = new SolrCommandHelper($entityTypeManager, $moduleHandler, $eventDispatcher, 'dt');
    $this->commandHelper = new SolrCommandHelper($entityTypeManager, $moduleHandler, $eventDispatcher, $module_extension_list);
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -9,6 +9,6 @@
 * Install new field types for legacy Solr versions.
 */
function search_api_solr_legacy_update_8001() {
  module_load_include('install', 'search_api_solr');
  \Drupal::moduleHandler()->loadInclude('search_api_solr', 'install');
  search_api_solr_update_helper_install_configs();
}
Loading