Skip to content

Commit

Permalink
ENH Avoid using deprecated API (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Oct 21, 2024
1 parent db09634 commit 47af9f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Admin/WorkflowDefinitionExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? '');
}
Expand Down

0 comments on commit 47af9f5

Please sign in to comment.