From b7f92a71cfc8fcdf71167277ae8babf51c0f666c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 26 Jan 2016 11:33:43 +0100 Subject: [PATCH] remove unused param in aggregators type + fix bug with labels --- Form/Type/Export/AggregatorType.php | 4 ---- Form/Type/Export/ExportType.php | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Form/Type/Export/AggregatorType.php b/Form/Type/Export/AggregatorType.php index bcbe48ec7..ad68340d6 100644 --- a/Form/Type/Export/AggregatorType.php +++ b/Form/Type/Export/AggregatorType.php @@ -69,10 +69,6 @@ class AggregatorType extends AbstractType public function configureOptions(OptionsResolver $resolver) { $resolver->setRequired('aggregator_alias') - ->setRequired('aggregators_length') - ->setAllowedTypes(array( - 'aggregators_length' => 'int' - )) ->setDefault('compound', true) ; } diff --git a/Form/Type/Export/ExportType.php b/Form/Type/Export/ExportType.php index 21d525b7e..b0d38e989 100644 --- a/Form/Type/Export/ExportType.php +++ b/Form/Type/Export/ExportType.php @@ -73,16 +73,14 @@ class ExportType extends AbstractType $builder->add($filterBuilder); //add aggregators - $aggregators = iterator_to_array($this->exportManager - ->getAggregatorsApplyingOn($export->supportsModifiers())); + $aggregators = $this->exportManager + ->getAggregatorsApplyingOn($export->supportsModifiers()); $aggregatorBuilder = $builder->create('aggregators', 'form', array('compound' => true)); - $nb = count($aggregators); foreach($aggregators as $alias => $aggregator) { $aggregatorBuilder->add($alias, new AggregatorType($this->exportManager), array( 'aggregator_alias' => $alias, - 'aggregators_length' => $nb, 'label' => $aggregator->getTitle() )); }