mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
FIX Use configuration nesting wrapper around themed preview logic
This commit is contained in:
parent
091997027b
commit
c02181e69b
@ -21,19 +21,18 @@ class UserFormRecipientItemRequest extends GridFieldDetailForm_ItemRequest
|
||||
public function preview()
|
||||
{
|
||||
// Enable theme for preview (may be needed for Shortcodes)
|
||||
$previous_theme_enabled = Config::inst()->get('SSViewer', 'theme_enabled');
|
||||
Config::nest();
|
||||
Config::inst()->update('SSViewer', 'theme_enabled', true);
|
||||
|
||||
$ret = $this->customise(new ArrayData(array(
|
||||
$content = $this->customise(new ArrayData(array(
|
||||
'Body' => $this->record->getEmailBodyContent(),
|
||||
'HideFormData' => $this->record->HideFormData,
|
||||
'Fields' => $this->getPreviewFieldData()
|
||||
)))->renderWith($this->record->EmailTemplate);
|
||||
|
||||
// reset theme preview value
|
||||
Config::inst()->update('SSViewer', 'theme_enabled', $previous_theme_enabled);
|
||||
Config::unnest();
|
||||
|
||||
return $ret;
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user