Skip to content

Commit

Permalink
Merge pull request #167 from pantheon-systems/RobLoach-3320326--argum…
Browse files Browse the repository at this point in the history
…entcounterror

Issue #3320326 by cslevy: ArgumentCountError when trying to post schema
  • Loading branch information
stovak authored Mar 29, 2023
2 parents 6515bb5 + f263178 commit 2e0b564
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion search_api_pantheon.services.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
search_api_pantheon.schema_poster:
class: Drupal\search_api_pantheon\Services\SchemaPoster
arguments: ['@logger.factory', '@search_api_pantheon.pantheon_guzzle', '@entity_type.manager']
arguments: ['@logger.factory', '@search_api_pantheon.pantheon_guzzle', '@entity_type.manager', '@extension.list.module']
search_api_pantheon.endpoint:
class: Drupal\search_api_pantheon\Services\Endpoint
arguments: [[], '@entity_type.manager']
Expand Down
14 changes: 12 additions & 2 deletions src/Services/SchemaPoster.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Drupal\Component\FileSystem\FileSystem;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\search_api_solr\Controller\SolrConfigSetController;
use GuzzleHttp\ClientInterface;
Expand Down Expand Up @@ -50,17 +51,26 @@ class SchemaPoster implements LoggerAwareInterface {
*/
protected EntityTypeManagerInterface $entityTypeManager;

/**
* The module extension list.
*
* @var \Drupal\Core\Extension\ModuleExtensionList
*/
protected $moduleExtensionList;

/**
* Class Constructor.
*/
public function __construct(
LoggerChannelFactoryInterface $logger_factory,
PantheonGuzzle $client,
EntityTypeManagerInterface $entity_type_manager
EntityTypeManagerInterface $entity_type_manager,
ModuleExtensionList $module_extension_list
) {
$this->logger = $logger_factory->get('PantheonSearch');
$this->client = $client;
$this->entityTypeManager = $entity_type_manager;
$this->moduleExtensionList = $module_extension_list;
}

/**
Expand Down Expand Up @@ -242,7 +252,7 @@ public function getSolrFiles(string $server_id = 'pantheon_solr8') {
'cannot retrieve the solr server connection settings from the database'
);
}
$solr_configset_controller = new SolrConfigSetController();
$solr_configset_controller = new SolrConfigSetController($this->moduleExtensionList);
$solr_configset_controller->setServer($server);

return $solr_configset_controller->getConfigFiles();
Expand Down

0 comments on commit 2e0b564

Please sign in to comment.