Commit 267364b2 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Merge branch 'remove-extension-from-solr-if-deleted' into 'develop'

Remove extension from solr if deleted

See merge request t3o/ter!336
parents 5803ea7c 4a232327
Pipeline #4514 failed with stages
in 15 minutes and 8 seconds
......@@ -14,6 +14,7 @@ namespace T3o\TerFe2\Controller;
* The TYPO3 project - inspiring people to share!
*/
use ApacheSolrForTypo3\Solr\GarbageCollector;
use ApacheSolrForTypo3\Solr\IndexQueue\Queue;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -225,7 +226,14 @@ class RegisterkeyController extends \T3o\TerFe2\Controller\AbstractTerBasedContr
} elseif ((strtolower($extension->getFrontendUser()) == strtolower($GLOBALS['TSFE']->fe_user->user['username'])) || $this->securityRole->isAdmin()) {
// Deleted in ter, then delete the key in the ter_fe2 extension table
if ($this->terConnection->deleteExtensionKey($extension->getExtKey())) {
$extensionUid = $extension->getUid();
$this->extensionRepository->remove($extension);
// ext:solr garbage collector
if (ExtensionManagementUtility::isLoaded('solr')) {
$garbageCollector = GeneralUtility::makeInstance(GarbageCollector::class);
$garbageCollector->collectGarbage('tx_terfe2_domain_model_extension', $extensionUid);
}
$this->addFlashMessage(
'',
$this->translate('registerkey.deleted', array($extension->getExtKey())),
......
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