Commit f2a7b0c1 authored by Benni Mack's avatar Benni Mack
Browse files

Merge branch 'bugfix/add-review-state-to-xml-file' into 'develop'

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

See merge request t3o/ter!541
parents 2205adce bef73beb
Pipeline #9342 passed with stages
in 11 minutes and 18 seconds
......@@ -57,6 +57,7 @@ class CombinedExtensionRepository
->fetch();
$basicExtensionInformation[$extensionKey] = [
'extensionuid' => $extensionKeyRow['uid'],
'ownerusername' => $extensionKeyRow['frontend_user'],
'downloads' => $extensionKeyRow['downloads'],
'external_manual' => $extensionKeyRow['external_manual'] ?: ''
......@@ -88,6 +89,9 @@ class CombinedExtensionRepository
$groupedVersionsByExtension[$extensionKey]['ownerusername'] = $genericExtensionInformation['ownerusername'];
$groupedVersionsByExtension[$extensionKey]['downloads'] = $genericExtensionInformation['downloads'];
$versionInformation = $this->getVersionInformation($basicExtensionInformation[$extensionKey]['extensionuid'], $versionNumber);
$row['reviewstate'] = $versionInformation['review_state'];
if (!empty($genericExtensionInformation['external_manual'])) {
$row['external_manual'] = $genericExtensionInformation['external_manual'];
} else {
......@@ -99,9 +103,29 @@ class CombinedExtensionRepository
}
$groupedVersionsByExtension[$extensionKey]['versions'][$versionNumber] = $row;
}
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