Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC break related to grid filtering in 1.13.1 #357

Open
dannyvw opened this issue Dec 3, 2024 · 0 comments
Open

BC break related to grid filtering in 1.13.1 #357

dannyvw opened this issue Dec 3, 2024 · 0 comments

Comments

@dannyvw
Copy link

dannyvw commented Dec 3, 2024

We have the following configuration which works in 1.13.0 but in 1.13.1 there is a BC break because of this PR https://github.com/Sylius/SyliusGridBundle/pull/345/files

We have multiple configurations like this which all using the EntityFilter as class.

    grid.filter.item_tag:
        autoconfigure: false
        class: 'App\Grid\Filter\EntityFilter'
        tags:
            - { name: 'sylius.grid_filter', type: 'item_tag', form_type: 'App\Form\Type\Filter\ItemTagFilterType' }

This filter is autoconfigure/autowired by Symfony.

<?php

declare(strict_types=1);

namespace App\Grid\Filter;

use Sylius\Component\Grid\Data\DataSourceInterface;
use Sylius\Component\Grid\Filtering\ConfigurableFilterInterface;
use App\Form\Type\Filter\ResourceFilterType;

final class EntityFilter implements ConfigurableFilterInterface
{
    public function apply(DataSourceInterface $dataSource, string $name, $data, array $options): void
    {
         // code
    }

    public static function getFormType(): string
    {
        return ResourceFilterType::class;
    }

    public static function getType(): string
    {
        return 'resource';
    }
}

All services are now registered with the name resource instead of item_tag. This will trigger an error that the resource is already configured.

Only using FilterInterface instead of ConfigurableFilterInterface doesn't work either because the getType/getFormType must be configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant