Skip to content

Commit

Permalink
PIM-8318: Upgrade Symfony patch version to 3.4.26 to fix Intl issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jmleroux committed Apr 30, 2019
1 parent 954e4da commit b0641bb
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG-2.3.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 2.3.x

## Improvement

- PIM-8318: Bump Symfony version to 3.4.26 to fix Intl issues.

# 2.3.40 (2019-04-30)

# 2.3.39 (2019-04-23)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"symfony/monolog-bundle": "3.1.0",
"symfony/swiftmailer-bundle": "3.0.3",
"symfony/security-acl": "3.0.0",
"symfony/symfony": "3.4.25",
"symfony/symfony": "3.4.26",
"symfony/thanks": "^1.0",
"symfony/polyfill-apcu": "1.4.0",
"twig/extensions": "1.2.0",
Expand Down
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Pim\Bundle\FilterBundle\Form\Type\Filter;

use Oro\Bundle\FilterBundle\Form\Type\Filter\ChoiceFilterType;
use Pim\Bundle\FilterBundle\Form\Type\UnstructuredType;
use Pim\Component\Catalog\Query\Filter\Operators;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
Expand Down Expand Up @@ -46,7 +46,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
$builder->add('type', $options['operator_type'], ['choices' => $this->getOperatorChoices($options)]);
$builder->add('value', TextType::class);
$builder->add('value', UnstructuredType::class);
$builder->add('valueChoices', ChoiceType::class, $options['field_options'] + ['mapped' => false]);
}

Expand Down
33 changes: 33 additions & 0 deletions src/Pim/Bundle/FilterBundle/Form/Type/UnstructuredType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Pim\Bundle\FilterBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* This is an hack to accept multiple types in a form type, such as string and array.
* Actually, since this PR https://github.com/symfony/symfony/pull/29307, array is not accepted anymore
* when using native TextType.
*
* It prevents us to use filters in the datagrid accepting multiple type of values:
* - a list of string for IN LIST operator
* - a string for IS NOT EMPTY operator
*
* It is a BC break in a minor release because we were using a bug as a feature.
*
* @see https://github.com/symfony/symfony/issues/29809
*
* @copyright 2019 Akeneo SAS (http://www.akeneo.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class UnstructuredType extends AbstractType
{
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'compound' => false,
'multiple' => true,
));
}
}

0 comments on commit b0641bb

Please sign in to comment.