GithubHelp home page GithubHelp logo

Comments (5)

FredDut avatar FredDut commented on June 13, 2024 1

Hello,
I don't reproduce it anymore, neither do I.
It's fixed.
Thanks

from apydatagridbundle.

FredDut avatar FredDut commented on June 13, 2024

I forgot to say:
apy/datagrid-bundle 4.0.2
symfony 5.4.7
php 7.2.24

from apydatagridbundle.

mhor avatar mhor commented on June 13, 2024

HI, @FredDut it's seems to be a bug introduced here.

It's not TemplateWrapper class that should be use but ```Twig\Template``class

from apydatagridbundle.

FredDut avatar FredDut commented on June 13, 2024

Hi @mhor ,
rolling back to Twig\Template is not enough.
I've to change

public function setTemplate($template)
    {
        if (is_string($template)) {
            if (substr($template, 0, 8) === '__SELF__') {
                $this->templates = $this->getTemplatesFromString(substr($template, 8));
                $this->templates[] = $this->twig->loadTemplate(static::DEFAULT_TEMPLATE);
            } else {
                $this->templates = $this->getTemplatesFromString($template);
            }
        } elseif ($this->templates === null) {
            $this->templates[] = $this->twig->loadTemplate(static::DEFAULT_TEMPLATE);
        } else {
            throw new \Exception('Unable to load template');
        }

        return $this;
    }

in

public function setTemplate($template)
    {
        if (is_string($template)) {
            if (substr($template, 0, 8) === '__SELF__') {
                $this->templates = $this->getTemplatesFromString(substr($template, 8));
                $this->templates[] = $this->twig->loadTemplate(static::DEFAULT_TEMPLATE);
            } else {
                $this->templates = $this->getTemplatesFromString($template);
                $this->templates[] = $this->twig->loadTemplate(static::DEFAULT_TEMPLATE);
            }
        } elseif ($this->templates === null) {
            $this->templates[] = $this->twig->loadTemplate(static::DEFAULT_TEMPLATE);
        } else {
            throw new \Exception('Unable to load template');
        }

        return $this;
    }

or this

public function setTemplate($template)
    {
        if (is_string($template)) {
            if (substr($template, 0, 8) === '__SELF__') {
                $this->templates = $this->getTemplatesFromString(substr($template, 8));
            } else {
                $this->templates = $this->getTemplatesFromString($template);
            }
            $this->templates[] = $this->twig->loadTemplate(static::DEFAULT_TEMPLATE);
        } elseif ($this->templates === null) {
            $this->templates[] = $this->twig->loadTemplate(static::DEFAULT_TEMPLATE);
        } else {
            throw new \Exception('Unable to load template');
        }

        return $this;
    }

but I don't really know what I'm doing
I don't know why the DEFAULT_TEMPLATE is not loaded by getTemplatesFromString and why it was working before.

from apydatagridbundle.

npotier avatar npotier commented on June 13, 2024

Hello @FredDut thank you for reporting this bug.

I've updated the demo repo here https://github.com/npotier/apydatagrid-demo to reproduce this case.

With the latest version of APYDatagridBundle, I don't reproduce this bug.

Could you try and confirm it please ?

Thank you 😄

from apydatagridbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.