Don't show the NewsletterSignupForm unless there is a newsletter related to a BlogHolder that exists

This commit is contained in:
Sean Harvey 2007-12-20 03:31:38 +00:00
parent 10f5213192
commit d1c6825941
1 changed files with 4 additions and 1 deletions

View File

@ -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');
}
}
/**