From 47561b252fc4fc49cb0c963522012e184cf2048f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Thu, 16 Aug 2018 17:02:19 +0200 Subject: [PATCH] Revert "Change URL behavior is now configurable" This reverts commit 2e9d21c --- README.md | 1 - src/DependencyInjection/Configuration.php | 2 -- src/DependencyInjection/EverlutionAjaxcomExtension.php | 1 - src/Mutation/ChangeUrl.php | 5 ++--- src/Resources/config/services.yml | 1 - 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 16e4854..e1db23d 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,6 @@ everlution_ajaxcom: flash_template: @EverlutionAjaxcom/flash_message.html.twig flash_block_id: flash_message persistent_class: ajaxcom-persistent - change_url: true blocks_to_render: # default value is empty array - when you provide this value, AjaxcomBundle will automatically render these blocks within each AJAX request - id: 'content' - id: 'navigation' diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index f8d5e97..8d91ddd 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -18,7 +18,6 @@ class Configuration implements ConfigurationInterface const FLASH_BLOCK_ID = 'flash_block_id'; const PERSISTENT_CLASS = 'persistent_class'; const BLOCKS_TO_RENDER = 'blocks_to_render'; - const CHANGE_URL = 'change_url'; const ID = 'id'; const REFRESH = 'refresh'; @@ -32,7 +31,6 @@ public function getConfigTreeBuilder() ->scalarNode(self::FLASH_TEMPLATE)->defaultValue('@EverlutionAjaxcom/flash_message.html.twig')->end() ->scalarNode(self::FLASH_BLOCK_ID)->defaultValue('flash_message')->end() ->scalarNode(self::PERSISTENT_CLASS)->defaultValue('ajaxcom-persistent')->end() - ->scalarNode(self::CHANGE_URL)->defaultTrue()->end() ->arrayNode(self::BLOCKS_TO_RENDER) ->arrayPrototype() ->children() diff --git a/src/DependencyInjection/EverlutionAjaxcomExtension.php b/src/DependencyInjection/EverlutionAjaxcomExtension.php index 181813d..ced9e54 100644 --- a/src/DependencyInjection/EverlutionAjaxcomExtension.php +++ b/src/DependencyInjection/EverlutionAjaxcomExtension.php @@ -26,7 +26,6 @@ public function load(array $configs, ContainerBuilder $container) $container->setParameter('everlution.ajaxcom.flash_block_id', $config[C::FLASH_BLOCK_ID]); $container->setParameter('everlution.ajaxcom.persistent_class', $config[C::PERSISTENT_CLASS]); $container->setParameter('everlution.ajaxcom.blocks_to_render', $config[C::BLOCKS_TO_RENDER]); - $container->setParameter('everlution.ajaxcom.change_url', $config[C::CHANGE_URL]); $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); diff --git a/src/Mutation/ChangeUrl.php b/src/Mutation/ChangeUrl.php index ac70e61..1847082 100644 --- a/src/Mutation/ChangeUrl.php +++ b/src/Mutation/ChangeUrl.php @@ -22,13 +22,12 @@ class ChangeUrl implements MutatorInterface /** @var UrlGeneratorInterface */ private $router; /** @var bool */ - private $changeUrl; + private $changeUrl = true; - public function __construct(RequestStack $requestStack, UrlGeneratorInterface $router, bool $changeUrl) + public function __construct(RequestStack $requestStack, UrlGeneratorInterface $router) { $this->router = $router; $this->request = $requestStack->getMasterRequest(); - $this->changeUrl = $changeUrl; } public function mutate(Handler $ajax): Handler diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yml index f0ea151..902eec4 100644 --- a/src/Resources/config/services.yml +++ b/src/Resources/config/services.yml @@ -79,7 +79,6 @@ services: arguments: - '@request_stack' - '@router.default' - - '%everlution.ajaxcom.change_url%' ajaxcom.mutation.flash_messages: class: Everlution\AjaxcomBundle\Mutation\FlashMessages