Merge pull request #927 from sebastian-meyer/fix-solr-core-creation

[BUG] Make Solr core name mandatory
This commit is contained in:
Sebastian Meyer 2023-03-21 10:00:41 +01:00 committed by GitHub
commit b224141d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -280,11 +280,13 @@ class NewTenantController extends AbstractController
$newRecord = GeneralUtility::makeInstance(SolrCore::class);
$newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')');
$indexName = Solr::createCore('');
$newRecord->setIndexName($indexName);
if (!empty($indexName)) {
$newRecord->setIndexName($indexName);
$this->solrCoreRepository->add($newRecord);
$this->solrCoreRepository->add($newRecord);
$doPersist = true;
$doPersist = true;
}
}
// We must persist here, if we changed anything.

View File

@ -118,6 +118,8 @@ class DataHandler implements LoggerAwareInterface
$fieldArray['index_name'] = Solr::createCore($fieldArray['index_name']);
if (empty($fieldArray['index_name'])) {
$this->logger->error('Could not create new Apache Solr core');
// Unset all fields to prevent new database record if Solr core creation failed.
unset($fieldArray);
}
break;
}

View File

@ -44,6 +44,7 @@ return [
'max' => 255,
'eval' => 'alphanum,nospace,unique',
'default' => '',
'readOnly' => 1,
'fieldInformation' => [
'solrCoreStatus' => [
'renderType' => 'solrCoreStatus',