Commit ec385b89 authored by Tomas Norre Mikkelsen's avatar Tomas Norre Mikkelsen

Merge branch 'fixes-indexer-when-no-last-version-exists' into 'develop'

Adds documentation link and extension icon only if last version exists

See merge request !189
parents 7b11c0dc f4e1fd90
Pipeline #2173 passed with stages
in 1 minute and 34 seconds
......@@ -84,14 +84,6 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer {
$extension = $this->extensionRepository->findByUid($itemRecord['uid']);
if ($extension instanceof \T3o\TerFe2\Domain\Model\Extension) {
$document->setField(
'extensionIcon_stringS',
$this->getExtensionIcon(
$itemRecord['ext_key'],
$extension->getLastVersion()->getVersionString()
)
);
$typo3Dependency = $this->getDependencyVersionForPackage($extension, 'typo3');
$document->setField('extensionMinTYPO3Version_tIntS', $typo3Dependency['minimum']);
$document->setField('extensionMaxTYPO3Version_tIntS', $typo3Dependency['maximum']);
......@@ -120,10 +112,17 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer {
$document->setField('typo3support_stringM', $typo3Support);
// add documentation link
/** @var \T3o\TerFe2\Service\Documentation $documentationService */
$documentationService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\Documentation::class);
$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString(), true);
$documentationLink = '';
$extensionIcon = '';
if ($extension->getLastVersion() instanceof \T3o\TerFe2\Domain\Model\Version) {
$extensionIcon = $this->getExtensionIcon($itemRecord['ext_key'], $extension->getLastVersion()->getVersionString());
/** @var \T3o\TerFe2\Service\Documentation $documentationService */
$documentationService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\Documentation::class);
$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString(), true);
}
$document->setField('extensionDocumentationLink_stringS', $documentationLink);
$document->setField('extensionIcon_stringS', $extensionIcon);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment