You are here

public function SolrConfigSetController::streamSchemaExtraFieldsXml in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x src/Controller/SolrConfigSetController.php \Drupal\search_api_solr\Controller\SolrConfigSetController::streamSchemaExtraFieldsXml()

Streams schema_extra_fields.xml.

Parameters

\Drupal\search_api\ServerInterface $search_api_server: The Search API server entity.

Return value

\Symfony\Component\HttpFoundation\Response The HTTP response object.

Throws

\Drupal\search_api\SearchApiException

1 string reference to 'SolrConfigSetController::streamSchemaExtraFieldsXml'
search_api_solr.routing.yml in ./search_api_solr.routing.yml
search_api_solr.routing.yml

File

src/Controller/SolrConfigSetController.php, line 97

Class

SolrConfigSetController
Provides different listings of SolrFieldType.

Namespace

Drupal\search_api_solr\Controller

Code

public function streamSchemaExtraFieldsXml(ServerInterface $search_api_server) : Response {
  try {
    return $this
      ->streamXml('schema_extra_fields.xml', $this
      ->getSchemaExtraFieldsXml($search_api_server));
  } catch (SearchApiSolrConflictingEntitiesException $e) {
    $this
      ->messenger()
      ->addError($this
      ->t('Some enabled parts of the configuration conflict with others: @conflicts', [
      '@conflicts' => new FormattableMarkup($e, []),
    ]));
  }
  return new RedirectResponse($search_api_server
    ->toUrl('canonical')
    ->toString());
}