Skip to content

Commit

Permalink
Revert "Change URL behavior is now configurable"
Browse files Browse the repository at this point in the history
This reverts commit 2e9d21c
  • Loading branch information
ostrolucky committed Aug 16, 2018
1 parent 5c366d5 commit 47561b2
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 0 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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()
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/EverlutionAjaxcomExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
5 changes: 2 additions & 3 deletions src/Mutation/ChangeUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ services:
arguments:
- '@request_stack'
- '@router.default'
- '%everlution.ajaxcom.change_url%'

ajaxcom.mutation.flash_messages:
class: Everlution\AjaxcomBundle\Mutation\FlashMessages
Expand Down

0 comments on commit 47561b2

Please sign in to comment.