Skip to content

Commit

Permalink
Merge pull request #57 from szymach/dev2
Browse files Browse the repository at this point in the history
Fixed wrong template returned in list element context and service definition duplication
  • Loading branch information
rn0 authored Nov 30, 2016
2 parents 2380038 + 7b0dd26 commit 3c75d9c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ sudo: false
cache:
directories:
- $HOME/.composer/cache
- vendor

matrix:
include:
- php: 5.4
env:
- DEPENDENCIES='low'
- COMPOSER_FLAGS='--prefer-lowest'
- php: 5.5
- php: 5.6
env:
Expand All @@ -26,9 +27,10 @@ matrix:
before_install:
- phpenv config-rm xdebug.ini
- composer self-update
- if [[ "$DEPENDENCIES" != "low" && ! $SYMFONY_VERSION ]]; then composer update -n --prefer-source; fi;
- if [[ "$DEPENDENCIES" != "low" && $SYMFONY_VERSION ]]; then composer require symfony/symfony:${SYMFONY_VERSION} -n --prefer-source; fi;
- if [[ "$DEPENDENCIES" == "low" ]]; then composer update --prefer-lowest -n --prefer-source; fi;
- if [[ $SYMFONY_VERSION ]]; then composer require symfony/symfony:${SYMFONY_VERSION} -n --no-update; fi;
# Avoid issues on composer update
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer update $COMPOSER_FLAGS

install:
- wget http://selenium-release.storage.googleapis.com/2.46/selenium-server-standalone-2.46.0.jar
Expand Down
10 changes: 5 additions & 5 deletions Doctrine/Admin/Context/ListElementContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ class ListElementContext extends BaseListElementContext
/**
* @var string
*/
private $formTemplate;
private $listTemplate;

public function __construct($requestHandlers, LocaleManager $localeManager, $formTemplate)
public function __construct($requestHandlers, LocaleManager $localeManager, $listTemplate)
{
parent::__construct($requestHandlers);
$this->localeManager = $localeManager;
$this->formTemplate = $formTemplate;
$this->listTemplate = $listTemplate;
}

/**
Expand All @@ -57,8 +57,8 @@ public function hasTemplateName()
*/
public function getTemplateName()
{
return $this->element->hasOption('template_form') ?
$this->element->getOption('template_form') : $this->formTemplate;
return $this->element->hasOption('template_list') ?
$this->element->getOption('template_list') : $this->listTemplate;
}

/**
Expand Down
1 change: 0 additions & 1 deletion FSiAdminTranslatableBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use FSi\Bundle\AdminTranslatableBundle\DependencyInjection\Compiler\MapBuilderPass;
use FSi\Bundle\AdminTranslatableBundle\DependencyInjection\Compiler\ResourceRepositoryPass;
use FSi\Bundle\AdminTranslatableBundle\DependencyInjection\Compiler\TranslatableWorkerPass;
use FSi\Bundle\AdminTranslatableBundle\DependencyInjection\Compiler\TwigGlobals;
use FSi\Bundle\AdminTranslatableBundle\DependencyInjection\FSIAdminTranslatableExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
1 change: 1 addition & 0 deletions Resources/config/context/resource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<parameters>
<parameter key="admin_translatable.resource.context.class">FSi\Bundle\AdminTranslatableBundle\Doctrine\Admin\Context\ResourceRepositoryContext</parameter>
<parameter key="admin_translatable.resource.map_builder.class">FSi\Bundle\AdminTranslatableBundle\Repository\TranslatableMapBuilder</parameter>
</parameters>

<services>
Expand Down
8 changes: 0 additions & 8 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,12 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="admin_translatable.resource.map_builder.class">FSi\Bundle\AdminTranslatableBundle\Repository\TranslatableMapBuilder</parameter>
<parameter key="admin_translatable.controller.locale.class">FSi\Bundle\AdminTranslatableBundle\Controller\LocaleController</parameter>
<parameter key="admin_translatable.manager.locale.class">FSi\Bundle\AdminTranslatableBundle\Manager\LocaleManager</parameter>
<parameter key="admin_translatable.factory.worker.translatable.class">FSi\Bundle\AdminTranslatableBundle\Factory\Worker\TranslatableWorker</parameter>
</parameters>

<services>
<!--Map Builder-->
<service id="admin_translatable.resource.map_builder" class="%admin_translatable.resource.map_builder.class%">
<argument>%fsi_resource_repository.resource.map_path%</argument>
<argument>%fsi_resource_repository.resource.types%</argument>
<argument type="service" id="fsi_doctrine_extensions.listener.translatable" />
</service>

<!--Managers-->
<service id="admin_translatable.manager.locale" class="%admin_translatable.manager.locale.class%">
<argument type="service" id="doctrine" />
Expand Down

0 comments on commit 3c75d9c

Please sign in to comment.