From 44356371ab0125df22bc48187fee9ccd2e25b608 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Sat, 7 May 2005 18:45:33 +0000 Subject: [PATCH] Delete maintainers when deleting applications and versions so maintainers aren't orphaned. --- include/application.php | 7 +++++++ include/version.php | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/application.php b/include/application.php index 28e98d4..f904c31 100644 --- a/include/application.php +++ b/include/application.php @@ -237,6 +237,13 @@ class Application { $oUrl = new Url($iUrlId); $oUrl->delete($bSilent); } + + // remove any supermaintainers for this application so we don't orphan them + $sQuery = "DELETE from appMaintainers WHERE appId='".$this->iAppId."';"; + if(!($hResult = query_appdb($sQuery))) + { + addmsg("Error removing app maintainers for the deleted application!", "red"); + } } if(!$bSilent) $this->mailSupermaintainers("delete"); diff --git a/include/version.php b/include/version.php index 6b26bcc..58e9bdd 100644 --- a/include/version.php +++ b/include/version.php @@ -240,10 +240,18 @@ class Version { $oUrl = new Url($iUrlId); $oUrl->delete($bSilent); } + + // remove any maintainers for this version so we don't orphan them + $sQuery = "DELETE from appMaintainers WHERE versionId='".$this->iVersionId."';"; + if(!($hResult = query_appdb($sQuery))) + { + addmsg("Error removing version maintainers for the deleted version!", "red"); + } } if(!$bSilent) $this->mailMaintainers("delete"); - $this->mailSubmitter(true); + + $this->mailSubmitter(true); }