diff --git a/lib/Alchemy/Phrasea/Controller/Prod/EditController.php b/lib/Alchemy/Phrasea/Controller/Prod/EditController.php index 44a20398fb..7e6bf7021f 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/EditController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/EditController.php @@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Controller\Prod; use Alchemy\Phrasea\Application\Helper\DataboxLoggerAware; use Alchemy\Phrasea\Application\Helper\DispatcherAware; +use Alchemy\Phrasea\Application\Helper\SubDefinitionSubstituerAware; use Alchemy\Phrasea\Controller\Controller; use Alchemy\Phrasea\Controller\RecordsRequest; use Alchemy\Phrasea\Core\Event\RecordEdit; @@ -23,6 +24,7 @@ class EditController extends Controller { use DataboxLoggerAware; use DispatcherAware; + use SubDefinitionSubstituerAware; public function submitAction(Request $request) { @@ -373,12 +375,4 @@ class EditController extends Controller return $this->app->json(['success' => true]); } - - /** - * @return SubdefSubstituer - */ - private function getSubDefinitionSubstituer() - { - return $this->app['subdef.substituer']; - } } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/LazaretController.php b/lib/Alchemy/Phrasea/Controller/Prod/LazaretController.php index d7b8ab7298..f4261498c5 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/LazaretController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/LazaretController.php @@ -14,6 +14,7 @@ use Alchemy\Phrasea\Application\Helper\DataboxLoggerAware; use Alchemy\Phrasea\Application\Helper\DelivererAware; use Alchemy\Phrasea\Application\Helper\EntityManagerAware; use Alchemy\Phrasea\Application\Helper\FilesystemAware; +use Alchemy\Phrasea\Application\Helper\SubDefinitionSubstituerAware; use Alchemy\Phrasea\Border; use Alchemy\Phrasea\Border\Attribute\AttributeInterface; use Alchemy\Phrasea\Controller\Controller; @@ -32,6 +33,7 @@ class LazaretController extends Controller use DelivererAware; use EntityManagerAware; use FilesystemAware; + use SubDefinitionSubstituerAware; /** * List all elements in lazaret @@ -460,12 +462,4 @@ class LazaretController extends Controller { return $this->app['border-manager']; } - - /** - * @return SubdefSubstituer - */ - private function getSubDefinitionSubstituer() - { - return $this->app['subdef.substituer']; - } } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/ToolsController.php b/lib/Alchemy/Phrasea/Controller/Prod/ToolsController.php index 05a88e577c..95d06d8de6 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/ToolsController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/ToolsController.php @@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Controller\Prod; use Alchemy\Phrasea\Application\Helper\DataboxLoggerAware; use Alchemy\Phrasea\Application\Helper\FilesystemAware; +use Alchemy\Phrasea\Application\Helper\SubDefinitionSubstituerAware; use Alchemy\Phrasea\Controller\Controller; use Alchemy\Phrasea\Controller\RecordsRequest; use Alchemy\Phrasea\Exception\RuntimeException; @@ -28,6 +29,7 @@ class ToolsController extends Controller { use DataboxLoggerAware; use FilesystemAware; + use SubDefinitionSubstituerAware; public function indexAction(Request $request) { @@ -297,14 +299,6 @@ class ToolsController extends Controller return $this->app['mediavorus']; } - /** - * @return SubdefSubstituer - */ - private function getSubDefinitionSubstituer() - { - return $this->app['subdef.substituer']; - } - /** * @return PhraseanetMetadataSetter */ diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Prod/Edit.php b/lib/Alchemy/Phrasea/ControllerProvider/Prod/Edit.php index 873cdc1e41..8503615f07 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Prod/Edit.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Prod/Edit.php @@ -27,7 +27,11 @@ class Edit implements ControllerProviderInterface, ServiceProviderInterface $app['controller.prod.edit'] = $app->share(function (PhraseaApplication $app) { return (new EditController($app)) ->setDataboxLoggerLocator($app['phraseanet.logger']) - ->setDispatcher($app['dispatcher']); + ->setDispatcher($app['dispatcher']) + ->setSubDefinitionSubstituerLocator(function () use ($app) { + return $app['subdef.substituer']; + }) + ; }); } diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Prod/Lazaret.php b/lib/Alchemy/Phrasea/ControllerProvider/Prod/Lazaret.php index 8341b86d03..a70aa9e757 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Prod/Lazaret.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Prod/Lazaret.php @@ -35,7 +35,11 @@ class Lazaret implements ControllerProviderInterface, ServiceProviderInterface }) ->setFileSystemLocator(function () use ($app) { return $app['filesystem']; - }); + }) + ->setSubDefinitionSubstituerLocator(function () use ($app) { + return $app['subdef.substituer']; + }) + ; }); } diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Prod/Tools.php b/lib/Alchemy/Phrasea/ControllerProvider/Prod/Tools.php index d2249a82b7..e9a689c1b8 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Prod/Tools.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Prod/Tools.php @@ -30,6 +30,9 @@ class Tools implements ControllerProviderInterface, ServiceProviderInterface ->setFileSystemLocator(function () use ($app) { return $app['filesystem']; }) + ->setSubDefinitionSubstituerLocator(function () use ($app) { + return $app['subdef.substituer']; + }) ; }); }