API Restrict "to" destination selection to only fields with pre-defined values

This commit is contained in:
Damian Mooyman 2015-08-19 14:04:11 +12:00
parent ee62d8956f
commit 879dd38328

View File

@ -132,9 +132,8 @@ class UserDefinedForm_EmailRecipient extends DataObject {
); );
$validSubjectFields->merge($multiOptionFields); $validSubjectFields->merge($multiOptionFields);
// To address can only be email fields or multi option fields // To address cannot be unbound, so restrict to pre-defined lists
$validEmailToFields = new ArrayList($validEmailFromFields->toArray()); $validEmailToFields = $multiOptionFields;
$validEmailToFields->merge($multiOptionFields);
// Build fieldlist // Build fieldlist
$fields = FieldList::create(Tabset::create('Root')->addExtraClass('EmailRecipientForm')); $fields = FieldList::create(Tabset::create('Root')->addExtraClass('EmailRecipientForm'));