com web/bugs: Fix patch display: templates/listpatches.php www/bug.php www/patch-display.php
| From: | Rasmus Lerdorf | Date: | Sat, 21 Jul 2018 13:31:06 +0000 |
| Subject: | com web/bugs: Fix patch display: templates/listpatches.php www/bug.php www/patch-display.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-27155@lists.php.net to get a copy of this message | ||
Commit: 97246d716b17fc8cb5be51812d6f40e07c811e9c
Author: Rasmus Lerdorf <rasmus@php.net> Sat, 21 Jul 2018 09:31:06 -0400
Parents: c75a11c6847b3f3e970c163fb0c5c69c2075ca07
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=97246d716b17fc8cb5be51812d6f40e07c811e9c
Log:
Fix patch display
Changed paths:
M templates/listpatches.php
M www/bug.php
M www/patch-display.php
Diff:
diff --git a/templates/listpatches.php b/templates/listpatches.php
index 8c848f0..fc6ef33 100644
--- a/templates/listpatches.php
+++ b/templates/listpatches.php
@@ -9,7 +9,9 @@
<?php } ?>
</td>
</tr>
-<?php foreach ($patches as $pname => $revs) { ?>
+<?php
+foreach ($patches as $fpa) { $fixed[$fpa['patch']][] = [ $fpa['revision'],
$fpa['developer'] ]; }
+foreach ($fixed as $pname => $revs) { ?>
<tr>
<th class="details">
Patch <a href="patch-display.php?bug_id=<?php echo $bug_id;
?>&patch=<?php echo urlencode($pname); ?>&revision=latest"><?php
echo clean($pname); ?></a>
diff --git a/www/bug.php b/www/bug.php
index bcddf97..6807fd2 100644
--- a/www/bug.php
+++ b/www/bug.php
@@ -1072,10 +1072,14 @@ if ($show_bug_info && $bug_id != 'PREVIEW' &&
$bug['status'] !== 'Spam') {
require_once "{$ROOT_DIR}/include/classes/bug_patchtracker.php";
$patches = new Bug_Patchtracker;
$p = $patches->listPatches($bug_id);
-
+ $revs = [];
echo "<h2>Patches</h2>\n";
- foreach ($p as $name => $revisions)
+ foreach ($p as $patch) {
+ $revs[$patch['patch']][] = [$patch['revision'],
$patch['developer']];
+ }
+
+ foreach ($revs as $name => $revisions)
{
$obsolete = $patches->getObsoletingPatches($bug_id, $name, $revisions[0][0]);
$style = !empty($obsolete) ? ' style="background-color: yellow; text-decoration:
line-through;" ' : '';
diff --git a/www/patch-display.php b/www/patch-display.php
index 1fed782..831e340 100644
--- a/www/patch-display.php
+++ b/www/patch-display.php
@@ -53,7 +53,7 @@ if (isset($patch_name) && isset($revision)) {
if ($revision == 'latest') {
$revisions = $patchinfo->listRevisions($buginfo['id'], $patch_name);
if (isset($revisions[0])) {
- $revision = $revisions[0][0];
+ $revision = $revisions[0]['revision'];
}
}