Fixed links to Errors tab from Information tab (Summary).

This commit is contained in:
Dmitry Khomutov 2017-11-09 23:18:10 +07:00
commit 1304ca29f7
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
4 changed files with 23 additions and 9 deletions

View file

@ -425,9 +425,23 @@ class BuildStore extends Store
if ($stmt->execute()) {
$rtn = $stmt->fetchAll(\PDO::FETCH_ASSOC);
/** @var \PHPCensor\Store\BuildErrorStore $errorStore */
$errorStore = Factory::getStore('BuildError');
$rtn = array_reverse($rtn);
$rtn = array_map(function ($item) {
$rtn = array_map(function ($item) use ($key, $errorStore, $buildId) {
$item['meta_value'] = json_decode($item['meta_value'], true);
if ('plugin-summary' === $key) {
foreach ($item['meta_value'] as $stage => $stageData) {
foreach ($stageData as $plugin => $pluginData) {
$item['meta_value'][$stage][$plugin]['errors'] = $errorStore->getErrorTotalForBuild(
$buildId,
$plugin
);
}
}
}
return $item;
}, $rtn);