diff --git a/code/Model/Recipient/EmailRecipient.php b/code/Model/Recipient/EmailRecipient.php index 0b0b1ac..84dbe80 100644 --- a/code/Model/Recipient/EmailRecipient.php +++ b/code/Model/Recipient/EmailRecipient.php @@ -446,7 +446,11 @@ class EmailRecipient extends DataObject */ public function canView($member = null) { - return $this->Form()->canView($member); + if ($form = $this->Form()) { + return $form->canView($member); + } + + return parent::canView($member); } /** @@ -456,7 +460,11 @@ class EmailRecipient extends DataObject */ public function canEdit($member = null) { - return $this->Form()->canEdit($member); + if ($form = $this->Form()) { + return $form->canEdit($member); + } + + return parent::canEdit($member); } /** @@ -469,7 +477,7 @@ class EmailRecipient extends DataObject return $this->canEdit($member); } - /* + /** * Determine if this recipient may receive notifications for this submission * * @param array $data diff --git a/code/UserForm.php b/code/UserForm.php index 8c3215d..0145b5c 100644 --- a/code/UserForm.php +++ b/code/UserForm.php @@ -39,14 +39,14 @@ use SilverStripe\UserForms\Model\EditableFormField; use SilverStripe\View\Requirements; /** - * Defines the user defined functionality to be applied to any - * {@link DataObject} + * Defines the user defined functionality to be applied to any {@link DataObject} * */ -trait UserForm { - +trait UserForm +{ /** - * Built in extensions required by this page + * Built in extensions required by this page. + * * @config * @var array */