Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
add missing parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectricMaxxx committed Jul 28, 2017
1 parent f054065 commit e29366e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/DependencyInjection/SonataDoctrinePHPCRAdminExtension.php
Expand Up @@ -101,5 +101,9 @@ private function loadDocumentTree($config, ContainerBuilder $container)
);

$container->setParameter('sonata_admin_doctrine_phpcr.tree_block.configuration', $configuration);

foreach ($configuration as $key => $value) {
$container->setParameter('sonata_admin_doctrine_phpcr.tree_block.'.$key, $value);
}
}
}
2 changes: 1 addition & 1 deletion src/Resources/config/block.xml
Expand Up @@ -8,7 +8,7 @@
<tag name="sonata.block"/>
<argument>sonata_admin_doctrine_phpcr.tree_block</argument>
<argument type="service" id="templating"/>
<argument>%sonata_admin_doctrine_phpcr.tree_block.defaults%</argument>
<argument>%sonata_admin_doctrine_phpcr.tree_block.routing_defaults%</argument>
</service>
</services>
</container>
2 changes: 1 addition & 1 deletion src/Resources/config/doctrine_phpcr_form_types.xml
Expand Up @@ -4,7 +4,7 @@
<service id="sonata.admin.doctrine_phpcr.form.type.phpcr_odm_tree" class="Sonata\DoctrinePHPCRAdminBundle\Form\Type\TreeModelType">
<tag name="form.type" alias="doctrine_phpcr_odm_tree"/>
<call method="setDefaults">
<argument>%sonata_admin_doctrine_phpcr.tree_block.defaults%</argument>
<argument>%sonata_admin_doctrine_phpcr.tree_block.routing_defaults%</argument>
</call>
</service>
<service id="sonata.admin.doctrine_phpcr.form.type.phpcr_odm_tree_manager" class="Sonata\DoctrinePHPCRAdminBundle\Form\Type\TreeManagerType">
Expand Down
Expand Up @@ -41,5 +41,26 @@ public function testDocumentTreeDefaultValues()
'reorder' => true,
)
);

$this->assertContainerBuilderHasParameter(
'sonata_admin_doctrine_phpcr.tree_block.routing_defaults',
array()
);
$this->assertContainerBuilderHasParameter(
'sonata_admin_doctrine_phpcr.tree_block.repository_name',
null
);
$this->assertContainerBuilderHasParameter(
'sonata_admin_doctrine_phpcr.tree_block.sortable_by',
'position'
);
$this->assertContainerBuilderHasParameter(
'sonata_admin_doctrine_phpcr.tree_block.move',
true
);
$this->assertContainerBuilderHasParameter(
'sonata_admin_doctrine_phpcr.tree_block.reorder',
true
);
}
}

0 comments on commit e29366e

Please sign in to comment.