Skip to content

BC break related to grid filtering in 1.13.1 #357

@dannyvw

Description

@dannyvw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions