[aur-dev] [PATCH] Unset $pinned unconditionally when displaying comments
Signed-off-by: Mark Weiman <mark.weiman@markzz.com> --- web/lib/pkgbasefuncs.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index c0e672a..1691bff 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -252,8 +252,8 @@ function pkgbase_display_details($base_id, $row, $SID="") { $pinned = pkgbase_comments($base_id, $limit_pinned, false, true); if (!empty($pinned)) { include('pkg_comments.php'); - unset($pinned); } + unset($pinned); $limit = isset($_GET['comments']) ? 0 : 10; $comments = pkgbase_comments($base_id, $limit, $include_deleted); -- 2.7.1
On Tue, 16 Feb 2016 at 14:21:55, Mark Weiman wrote:
Signed-off-by: Mark Weiman <mark.weiman@markzz.com> --- web/lib/pkgbasefuncs.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) [...]
Added this to my patch queue with the following more detailed commit message: Unset $pinned unconditionally when displaying comments In pkg_comments.php, the $pinned variable is used to determine whether the template is supposed to print all comments or pinned comments only. If the $pinned variable is unset, the top 10 comments are printed, followed by an "All comments" link. If the $pinned variable is set, the pinned comments are printed and the "All comments" link below the comment listing is skipped. Thus, we need to make sure that this variable is always unset at the time we include the template to display all comments, even if it was empty before. Fixes FS#48194. Thanks!
On Tue, 16 Feb 2016 at 14:21:55, Mark Weiman wrote:
Signed-off-by: Mark Weiman <mark.weiman@markzz.com> --- web/lib/pkgbasefuncs.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index c0e672a..1691bff 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -252,8 +252,8 @@ function pkgbase_display_details($base_id, $row, $SID="") { $pinned = pkgbase_comments($base_id, $limit_pinned, false, true); if (!empty($pinned)) { include('pkg_comments.php'); - unset($pinned); } + unset($pinned);
We probably need the same fix in pkg_display_details(). Will submit a second version of the patch in a second.
$limit = isset($_GET['comments']) ? 0 : 10; $comments = pkgbase_comments($base_id, $limit, $include_deleted); -- 2.7.1
From: Mark Weiman <mark.weiman@markzz.com> In pkg_comments.php, the $pinned variable is used to determine whether the template is supposed to print all comments or pinned comments only. If the $pinned variable is unset, the top 10 comments are printed, followed by an "All comments" link. If the $pinned variable is set, the pinned comments are printed and the "All comments" link below the comment listing is skipped. Thus, we need to make sure that this variable is always unset at the time we include the template to display all comments, even if it was empty before. Fixes FS#48194. Signed-off-by: Mark Weiman <mark.weiman@markzz.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/lib/pkgbasefuncs.inc.php | 2 +- web/lib/pkgfuncs.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index c0e672a..1691bff 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -252,8 +252,8 @@ function pkgbase_display_details($base_id, $row, $SID="") { $pinned = pkgbase_comments($base_id, $limit_pinned, false, true); if (!empty($pinned)) { include('pkg_comments.php'); - unset($pinned); } + unset($pinned); $limit = isset($_GET['comments']) ? 0 : 10; $comments = pkgbase_comments($base_id, $limit, $include_deleted); diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 0e152dd..eaea318 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -629,8 +629,8 @@ function pkg_display_details($id=0, $row, $SID="") { $pinned = pkgbase_comments($base_id, $limit_pinned, false, true); if (!empty($pinned)) { include('pkg_comments.php'); - unset($pinned); } + unset($pinned); $limit = isset($_GET['comments']) ? 0 : 10; $comments = pkgbase_comments($base_id, $limit, $include_deleted); -- 2.7.1
participants (2)
-
Lukas Fleischer
-
Mark Weiman