bug #4059 Fix issue in CommonPostConfigurator (freepius)
bug #4059 Fix issue in CommonPostConfigurator (freepius)

This PR was merged into the 3.0.x-dev branch.

Discussion
----------

Fix issue in CommonPostConfigurator

Oops, I introduced a bug, sorry...
So... I reintroduce the last `if` condition (ie, `getCurrentPage() is 'index' or 'detail'`).
Because, `AbstractCrudController::renderFilters()` calls `...processFields()...` which calls the configurators (whose the CommonPostConfigurator).
And in the case of `renderFilters` action, the `getCurrentPage()` is null.
But in the case of `renderFilters` action, we must **not call** the `formatValueCallable` (because $value and $entity are null).

Well, it's not easy to explain, but I think that you see :-)
It's a pity to not be able to call the `formatValue` callables for custom actions.

So perhaps we have to test that condition?
```php
        $page = $context->getCrud()->getCurrentPage();
        $action = $context->getCrud()->getCurrentAction();

        // form pages and 'renderFilters' action don't use the formatted value, so don't compute it
        if (false === \in_array($page, [Crud::PAGE_NEW, Crud::PAGE_EDIT], true) && 'renderFilters' !== $action) {
            $formattedValue = $this->buildFormattedValueOption($field->getFormattedValue(), $field, $entityDto);
            $field->setFormattedValue($formattedValue);
        }
```

Thanks

Commits
-------

723a509f Fix issue in CommonPostConfigurator

javiereguiluz/EasyAdminBundle,javiereguiluz/EasyAdminBundle