Fix regression that stopped package maintainers from pinning comments
diff mbox

Message ID 20171221032743.13403-1-eschwartz@archlinux.org
State Accepted, archived
Headers show

Commit Message

Eli Schwartz Dec. 21, 2017, 3:27 a.m. UTC
In commit 8c98db0b82cc85a4498589e5d60299fefd93b421 support was added for
package comaintainers to pin comments in addition to maintainers.

Due to a typo, the SQL query was reset halfway through and only added
the comaintainer IDs to the list of allowed users.

Fixes FS#56783

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 web/lib/pkgfuncs.inc.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lukas Fleischer Dec. 23, 2017, 9:55 p.m. UTC | #1
On Thu, 21 Dec 2017 at 04:27:43, Eli Schwartz wrote:
> In commit 8c98db0b82cc85a4498589e5d60299fefd93b421 support was added for
> package comaintainers to pin comments in addition to maintainers.
> 
> Due to a typo, the SQL query was reset halfway through and only added
> the comaintainer IDs to the list of allowed users.
> 
> Fixes FS#56783
> 
> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
> ---
>  web/lib/pkgfuncs.inc.php | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> [...]

Good catch! Applied, thanks!

Patch
diff mbox

diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index dbcf63e..d022ebe 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -100,7 +100,7 @@  function can_pin_comment($comment_id=0) {
 	$q.= "LEFT JOIN PackageComments AS pc ON pb.ID = pc.PackageBaseID ";
 	$q.= "WHERE pc.ID = " . intval($comment_id) . " ";
 	$q.= "UNION ";
-	$q = "SELECT pcm.UsersID FROM PackageComaintainers AS pcm ";
+	$q.= "SELECT pcm.UsersID FROM PackageComaintainers AS pcm ";
 	$q.= "LEFT JOIN PackageComments AS pc ";
 	$q.= "ON pcm.PackageBaseID = pc.PackageBaseID ";
 	$q.= "WHERE pc.ID = " . intval($comment_id);