From e8aa41b591528ad95c97cd89598b220456699816 Mon Sep 17 00:00:00 2001
From: Callan Barrett <wizzomafizzo@gmail.com>
Date: Mon, 5 May 2008 01:53:11 +0800
Subject: [PATCH] Don't reset category on update

When updating a package and no category is selected the category will no longer
reset itself to "none", it will only update if something else is chosen.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
---
 web/html/pkgsubmit.php |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index 24327e2..b88e62e 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -361,7 +361,9 @@ if ($_COOKIE["AURSID"]) {
 				$q.="Name='".mysql_real_escape_string($new_pkgbuild['pkgname'])."', ";
 				$q.="Version='".mysql_real_escape_string($new_pkgbuild['pkgver'])."-".
 				  mysql_real_escape_string($new_pkgbuild['pkgrel'])."',";
-				$q.="CategoryID=".mysql_real_escape_string($_REQUEST['category']).", ";
+				if ($_POST['category'] > 1) {
+  				$q.="CategoryID=".mysql_real_escape_string($_REQUEST['category']).", ";
+  			}
                 $q.="License='".mysql_real_escape_string($new_pkgbuild['license'])."', ";
                 $q.="Description='".mysql_real_escape_string($new_pkgbuild['pkgdesc'])."', ";
 				$q.="URL='".mysql_real_escape_string($new_pkgbuild['url'])."', ";
-- 
1.5.3.8

