From d1c6825941b2242fcdcd2384556713ce3f7245c4 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 20 Dec 2007 03:31:38 +0000 Subject: [PATCH] Don't show the NewsletterSignupForm unless there is a newsletter related to a BlogHolder that exists --- code/BlogHolder.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/BlogHolder.php b/code/BlogHolder.php index c6aa5b2..7fa6f6b 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -92,9 +92,12 @@ class BlogHolder extends Page { /** * Return a new instance of NewsletterSignupForm. + * If there is no related Newsletter, then don't show it. */ function NewsletterSignupForm() { - return new NewsletterSignupForm($this, 'NewsletterSignupForm'); + if($this->Newsletter() && $this->Newsletter()->ID) { + return new NewsletterSignupForm($this, 'NewsletterSignupForm'); + } } /**