diff --git a/src/Actions/NotifyUsersWorkflowAction.php b/src/Actions/NotifyUsersWorkflowAction.php index 584df71e..04c21861 100644 --- a/src/Actions/NotifyUsersWorkflowAction.php +++ b/src/Actions/NotifyUsersWorkflowAction.php @@ -3,6 +3,7 @@ namespace Symbiote\AdvancedWorkflow\Actions; use SilverStripe\Control\Email\Email; +use SilverStripe\Dev\Deprecation; use SilverStripe\Forms\HeaderField; use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\TextareaField; @@ -135,7 +136,7 @@ public function execute(WorkflowInstance $workflow) } - $view = SSViewer::fromString($this->EmailTemplate); + $view = Deprecation::withSuppressedNotice(fn() => SSViewer::fromString($this->EmailTemplate)); $this->extend('updateView', $view); foreach ($members as $member) { diff --git a/src/Admin/WorkflowDefinitionExporter.php b/src/Admin/WorkflowDefinitionExporter.php index 87a1dbdc..6301770e 100644 --- a/src/Admin/WorkflowDefinitionExporter.php +++ b/src/Admin/WorkflowDefinitionExporter.php @@ -108,9 +108,11 @@ public function export() */ public function format($templateData) { - $viewer = SSViewer::execute_template(['type' => 'Includes', 'WorkflowDefinitionExport'], $templateData); - // Temporary until we find the source of the replacement in SSViewer - $processed = str_replace('&', '&', $viewer ?? ''); + $viewer = SSViewer::create(['type' => 'Includes', 'WorkflowDefinitionExport']); + $viewer->setRewriteHashLinks(false); + $viewer->includeRequirements(false); + // str_replace is temporary until we find the source of the replacement in SSViewer + $processed = str_replace('&', '&', $viewer->process($templateData)); // Clean-up newline "gaps" that SSViewer leaves behind from the placement of template control structures return preg_replace("#^\R+|^[\t\s]*\R+#m", '', $processed ?? ''); }