Commit f4e1fd90 authored by Thomas Löffler's avatar Thomas Löffler

Adds documentation link and extension icon only if last version exists

parent f031d8a7
Pipeline #2164 passed with stages
in 1 minute and 31 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']);
......@@ -128,10 +120,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