Skip to content

Commit

Permalink
PIM-8318: Upgrade Symfony to 3.4.26 to fix Intl issues (#9966)
Browse files Browse the repository at this point in the history
* PIM-8318: Upgrade Symfony patch version to fix Intl issues

* PIM-8318: Upgrade Symfony patch version to 3.4.26 to fix Intl issues
  • Loading branch information
jmleroux committed Apr 30, 2019
1 parent 819b81c commit 2bfde27
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 55 deletions.
8 changes: 0 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ jobs:
- run:
name: Start containers
command: docker-compose up -d
- restore_cache:
name: Restore cache - vendor
keys:
- vendor-v1-{{ checksum "composer.lock" }}
- run:
name: Change owner on project dir after restoring cache
command: sudo chown -R 1000:1000 ../project
Expand All @@ -49,10 +45,6 @@ jobs:
- run:
name: Change owner on project dir after installing when there is no cache
command: sudo chmod -R 777 ../project
- save_cache:
paths:
- ./vendor
key: vendor-v7-{{ checksum "composer.lock" }}
- persist_to_workspace:
root: ~/
paths:
Expand Down
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.4",
"symfony/symfony": "3.4.26",
"symfony/thanks": "^1.0",
"symfony/polyfill-apcu": "1.4.0",
"twig/extensions": "1.2.0",
Expand Down
81 changes: 37 additions & 44 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 2bfde27

Please sign in to comment.