mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #1297 from heyday/6
fix: prevent CMS requirements from leaking into preview email
This commit is contained in:
commit
f2cda50320
@ -9,6 +9,7 @@ use SilverStripe\ORM\FieldType\DBField;
|
|||||||
use SilverStripe\UserForms\Model\EditableFormField\EditableFormHeading;
|
use SilverStripe\UserForms\Model\EditableFormField\EditableFormHeading;
|
||||||
use SilverStripe\UserForms\Model\EditableFormField\EditableLiteralField;
|
use SilverStripe\UserForms\Model\EditableFormField\EditableLiteralField;
|
||||||
use SilverStripe\View\ArrayData;
|
use SilverStripe\View\ArrayData;
|
||||||
|
use SilverStripe\View\Requirements;
|
||||||
use SilverStripe\View\SSViewer;
|
use SilverStripe\View\SSViewer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,14 +35,18 @@ class UserFormRecipientItemRequest extends GridFieldDetailForm_ItemRequest
|
|||||||
Config::nest();
|
Config::nest();
|
||||||
Config::modify()->set(SSViewer::class, 'theme_enabled', true);
|
Config::modify()->set(SSViewer::class, 'theme_enabled', true);
|
||||||
|
|
||||||
|
Requirements::clear();
|
||||||
|
|
||||||
$content = $this->customise([
|
$content = $this->customise([
|
||||||
'Body' => $this->record->getEmailBodyContent(),
|
'Body' => $this->record->getEmailBodyContent(),
|
||||||
'HideFormData' => (bool) $this->record->HideFormData,
|
'HideFormData' => (bool) $this->record->HideFormData,
|
||||||
'Fields' => $this->getPreviewFieldData()
|
'Fields' => $this->getPreviewFieldData()
|
||||||
])->renderWith($this->record->EmailTemplate);
|
])->renderWith($this->record->EmailTemplate);
|
||||||
|
|
||||||
|
Requirements::restore();
|
||||||
Config::unnest();
|
Config::unnest();
|
||||||
|
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user