Commit f2bf761d authored by Stefan Busemann's avatar Stefan Busemann
Browse files

[BUGFIX] Use doctrine for plugin detection

parent 7252afbc
......@@ -14,7 +14,9 @@ namespace TYPO3\Election\Controller;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\Election\Domain\Model\ElectionCircular;
use TYPO3\Election\Domain\Model\Elector;
use TYPO3\Election\Service\CircularService;
......@@ -165,12 +167,16 @@ class BeElectionCircularController extends AbstractProtectedBeController
*/
protected function isPluginInstalled()
{
$extendedDeleteClause = BackendUtility::BEenableFields('tt_content');
$count = $this->getDatabaseConnection()->exec_SELECTcountRows(
'uid',
'tt_content',
'CType LIKE "list" AND list_type LIKE "election_pi1" AND hidden=0 ' . $extendedDeleteClause
);
$where['CType']='list';
$where['list_type']='election_pi1';
$where['hidden']=0;
// todo check also for enable fields
#$extendedDeleteClause = BackendUtility::BEenableFields('tt_content');
$count = $this->getDatabaseConnection()
->getConnectionForTable('tt_content')
->count('uid','tt_content',$where);
return $count > 0;
}
......@@ -205,10 +211,10 @@ class BeElectionCircularController extends AbstractProtectedBeController
}
/**
* @return DatabaseConnection
* @return ConnectionPool
*/
protected function getDatabaseConnection()
{
return $GLOBALS['TYPO3_DB'];
return GeneralUtility::makeInstance(ConnectionPool::class);
}
}
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