Commit 588df510 authored by Thomas Löffler's avatar Thomas Löffler

Remove extension from index if all versions deleted

parent 7024aa2c
Pipeline #2376 passed with stages
in 1 minute and 24 seconds
......@@ -26,6 +26,10 @@ namespace T3o\TerFe2\Controller;
* This copyright notice MUST APPEAR in all copies of the script!
* **************************************************************** */
use ApacheSolrForTypo3\Solr\IndexQueue\Queue;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Controller for the extension key registration
*/
......@@ -276,6 +280,11 @@ class RegisterkeyController extends \T3o\TerFe2\Controller\AbstractTerBasedContr
$this->versionRepository->remove($version);
if (empty($version->getExtension()->getVersions())) {
$redirectToIndexAction = true;
// remove from index queue
if (ExtensionManagementUtility::isLoaded('solr')) {
$indexQueue = GeneralUtility::makeInstance(Queue::class);
$indexQueue->deleteItem('tx_terfe2_domain_model_extension', $version->getExtension()->getUid());
}
}
$this->addFlashMessage(
'',
......
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