From 79d5d0bcb4f9630a2b23c934c69fa66a95e7a265 Mon Sep 17 00:00:00 2001 From: Mathieu De Keyzer Date: Sat, 21 Sep 2024 11:28:08 +0200 Subject: [PATCH] ref: 'emsco_data_link' => Routes::DATA_LINK --- EMS/core-bundle/src/Form/DataField/WysiwygFieldType.php | 5 +++-- EMS/core-bundle/src/Twig/AppExtension.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/EMS/core-bundle/src/Form/DataField/WysiwygFieldType.php b/EMS/core-bundle/src/Form/DataField/WysiwygFieldType.php index a81ec52e5..1519251f4 100644 --- a/EMS/core-bundle/src/Form/DataField/WysiwygFieldType.php +++ b/EMS/core-bundle/src/Form/DataField/WysiwygFieldType.php @@ -8,6 +8,7 @@ use EMS\CoreBundle\Entity\FieldType; use EMS\CoreBundle\Form\Field\AnalyzerPickerType; use EMS\CoreBundle\Form\Field\WysiwygStylesSetPickerType; +use EMS\CoreBundle\Routes; use EMS\CoreBundle\Service\ElasticsearchService; use EMS\CoreBundle\Service\WysiwygStylesSetService; use EMS\Helpers\Standard\Type; @@ -122,7 +123,7 @@ public function reverseViewTransform($data, FieldType $fieldType): DataField $data ); - $path = $this->router->generate('emsco_data_link', ['key' => '__KEY__'], UrlGeneratorInterface::ABSOLUTE_PATH); + $path = $this->router->generate(Routes::DATA_LINK, ['key' => '__KEY__'], UrlGeneratorInterface::ABSOLUTE_PATH); $out = \preg_replace_callback( '/('.\preg_quote(\substr($path, 0, \strlen($path) - 7), '/').')(?P[^\n\r"\'\?]*)/i', fn ($matches) => 'ems://'.$matches['key'], @@ -154,7 +155,7 @@ public function viewTransform(DataField $dataField) fn ($matches) => $path.$matches[2], $out ); - $path = $this->router->generate('emsco_data_link', ['key' => '__KEY__'], UrlGeneratorInterface::ABSOLUTE_PATH); + $path = $this->router->generate(Routes::DATA_LINK, ['key' => '__KEY__'], UrlGeneratorInterface::ABSOLUTE_PATH); $out = \preg_replace_callback( '/ems:\/\/(?Pfile:([^\n\r"\'\?]*))/i', fn ($matches) => \str_replace('__KEY__', $matches['key'], $path), diff --git a/EMS/core-bundle/src/Twig/AppExtension.php b/EMS/core-bundle/src/Twig/AppExtension.php index 9e184b808..3f848f331 100644 --- a/EMS/core-bundle/src/Twig/AppExtension.php +++ b/EMS/core-bundle/src/Twig/AppExtension.php @@ -823,7 +823,7 @@ function ($matches) use ($path, $asFileName) { }, $input ); - $path = $this->router->generate('emsco_data_link', ['key' => '__KEY__'], UrlGeneratorInterface::ABSOLUTE_PATH); + $path = $this->router->generate(Routes::DATA_LINK, ['key' => '__KEY__'], UrlGeneratorInterface::ABSOLUTE_PATH); $out = \preg_replace_callback( '/ems:\/\/(?Pfile:([^\n\r"\'\?]*))/i', fn ($matches) => \str_replace('__KEY__', $matches['key'], $path),