Commit 832635b0 authored by Thomas Löffler's avatar Thomas Löffler

Merge branch 'change-ter-indexer-to-ignore-invalid-versions' into 'develop'

Check for existing last version before indexing

See merge request !196
parents 986710d8 23dcbb05
Pipeline #2182 passed with stages
in 2 minutes and 14 seconds
......@@ -83,7 +83,7 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer {
{
$extension = $this->extensionRepository->findByUid($itemRecord['uid']);
if ($extension instanceof \T3o\TerFe2\Domain\Model\Extension) {
if ($extension instanceof \T3o\TerFe2\Domain\Model\Extension && $extension->getLastVersion() instanceof \T3o\TerFe2\Domain\Model\Version) {
$typo3Dependency = $this->getDependencyVersionForPackage($extension, 'typo3');
$document->setField('extensionMinTYPO3Version_tIntS', $typo3Dependency['minimum']);
$document->setField('extensionMaxTYPO3Version_tIntS', $typo3Dependency['maximum']);
......@@ -111,18 +111,14 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer {
}
$document->setField('typo3support_stringM', $typo3Support);
$extensionIcon = $this->getExtensionIcon($itemRecord['ext_key'], $extension->getLastVersion()->getVersionString());
$document->setField('extensionIcon_stringS', $extensionIcon);
// add documentation link
$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);
}
/** @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