add more strict condition inside getNewletterTypeEditForm to make NewsleterAdmin more robust.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@40816 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2007-08-24 03:50:17 +00:00
parent 48939b8102
commit 628105c410

View File

@ -167,8 +167,8 @@ class NewsletterAdmin extends LeftAndMain {
if(isset($mailType) && is_object($mailType) && $mailType->GroupID) { if(isset($mailType) && is_object($mailType) && $mailType->GroupID) {
$group = DataObject::get_one("Group", "ID = $mailType->GroupID"); $group = DataObject::get_one("Group", "ID = $mailType->GroupID");
} }
//The function could be called from CMS with $mailType isset but with empty string.
if(isset($mailType)) { if(isset($mailType)&&$mailType) {
$fields = new FieldSet( $fields = new FieldSet(
new TextField("Title", "Newsletter Type"), new TextField("Title", "Newsletter Type"),
new TextField("FromEmail", "Send newsletters from"), new TextField("FromEmail", "Send newsletters from"),