Commit 9e153c50 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Add up-to-date review_state information from new version table

parent 8958a972
Pipeline #9340 passed with stages
in 12 minutes and 48 seconds
......@@ -88,6 +88,9 @@ class CombinedExtensionRepository
$groupedVersionsByExtension[$extensionKey]['ownerusername'] = $genericExtensionInformation['ownerusername'];
$groupedVersionsByExtension[$extensionKey]['downloads'] = $genericExtensionInformation['downloads'];
$versionInformation = $this->getVersionInformation($basicExtensionInformation['uid'], $versionNumber);
$row['reviewstate'] = $versionInformation['review_state'];
if (!empty($genericExtensionInformation['external_manual'])) {
$row['external_manual'] = $genericExtensionInformation['external_manual'];
} else {
......@@ -102,6 +105,27 @@ class CombinedExtensionRepository
return $groupedVersionsByExtension;
}
protected function getVersionInformation(int $extensionUid, string $versionNumber)
{
$queryBuilder = $this->getQueryBuilder('tx_terfe2_domain_model_version');
$queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction::class));
$version = $queryBuilder
->select('*')
->from('tx_terfe2_domain_model_version')
->where(
[
$queryBuilder->expr()->andX(
$queryBuilder->expr()->eq('extension', $queryBuilder->createNamedParameter($extensionUid)),
$queryBuilder->expr()->eq('version_string', $queryBuilder->createNamedParameter($versionNumber, \PDO::PARAM_STR))
)
]
)
->execute()
->fetch();
return $version;
}
protected function getQueryBuilder(string $table): QueryBuilder
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
......
Supports Markdown
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