[aur-dev] [PATCH 2/2] Display correct comment count on package base page

Lukas Fleischer archlinux at cryptocrack.de
Wed Jul 23 05:18:14 EDT 2014


Show the correct number of package base comments in the tool tip message
of the "Latest Comments" link.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/template/pkg_comments.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index d687cde..9961554 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -1,5 +1,11 @@
 <?php
-$base_id = pkgbase_from_pkgid($row['ID']);
+if (isset($row['BaseID'])) {
+	/* On a package details page. */
+	$base_id = $row['BaseID'];
+} else {
+	/* On a package base details page. */
+	$base_id = $row['ID'];
+}
 $count = pkgbase_comments_count($base_id);
 ?>
 <div id="news">
-- 
2.0.2


More information about the aur-dev mailing list