APY / APYDataGridBundle

Symfony Datagrid Bundle
MIT License
492 stars 344 forks source link

Symfony 5 support #1045

Closed jmontoyaa closed 1 year ago

jmontoyaa commented 4 years ago
jmontoyaa commented 4 years ago

I'm preparing another change to add support to Symfony 5

Thunderbird69 commented 4 years ago

SF5 support would be much appreciated ;) Thanks a bunch in advance

pierrotevrard-dbit commented 3 years ago

Got an error with this PR: Attempted to call an undefined method named "renderResponse" of class "Twig\Environment". in vendor/apy/datagrid-bundle/Grid/Grid.php (line 2152)

The method does not exists anymore and must be replaced by a code like:

        $content = $this->container->get('twig')->renderView($view, $parameters);

        if (null === $response) {
            $response = new Response();
        }

        $response->setContent($content);

        return $response;
pierrotevrard-dbit commented 3 years ago

I've finally made a branch for Twig 3.1 compatibility, see https://github.com/pierrotevrard-dbit/APYDataGridBundle/tree/fix/twig_31_compatibility

It does not seem backward compatible with Twig 2.0, sry

npotier commented 3 years ago

Hello,

I've been working on this branch https://github.com/APY/APYDataGridBundle/tree/feature/sf5-compat to have a working Bundle with latest version on Symfony 5.

All tests are green and I've created a real life example that also allows to test the bundle locally : https://github.com/npotier/apydatagrid-demo

I've created a PR here : https://github.com/APY/APYDataGridBundle/pull/1063

Feel free to tell me what you think about it.

FredDut commented 3 years ago

Hello, It's a nice job. I think something is missing: when you filter, the column is filtered but the value disappears from the input box. Regards

FredDut commented 2 years ago

Hello , Do you plan to merge fixes from jmontoya in sf5-compat branch? I can't see fixes for Export.php (630a1b5) , GridManager.php (56c62e1) and spaceless in blocks.html.twig (9425cd1) in sf5-compat branch. Maybe I misunderstand something.

FredDut commented 2 years ago

I think the datagrid is OK for php7.2 with this fixes. With php 7.4 it's not ok. When you extend the grid with custom twigs, columns or data are not initialized. Same problem for exports. I don't know what to do with this.

npotier commented 2 years ago

Hello @FredDut Thank you for your message. I've integrated the changes in the 4.0.1 tag of the bundle.

Unfortunately, I don't have access to packagist for this bundle in order to trigger an update

npotier commented 1 year ago

I think we can close this PR, as the modifications has been integrated in new versions. Feel free to add comment if necessary