You are here

function search_api_solr_update_8309 in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x search_api_solr.install \search_api_solr_update_8309()

Solarium 5 adjustments. Warning! If you have overwritten the connection settings, don't forget to adjust the 'path'. See the release notes for details.

File

./search_api_solr.install, line 1101
Install, update and uninstall functions for the Search API Solr module.

Code

function search_api_solr_update_8309() {

  // Remove the V1 API endpoint from the path.
  foreach (search_api_solr_update_helper_get_backend_configs() as $server_name => $backend_config) {
    $backend_config['connector_config']['path'] = preg_replace('@/solr$@', '/', $backend_config['connector_config']['path']);
    search_api_solr_update_helper_save_backend_config($server_name, $backend_config);
  }

  // Reset the states.
  \Drupal::state()
    ->delete('search_api_solr.endpoint.data');
}