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

Issue with template helper #81

Closed
althaus opened this issue Jul 9, 2013 · 14 comments
Closed

Issue with template helper #81

althaus opened this issue Jul 9, 2013 · 14 comments

Comments

@althaus
Copy link

althaus commented Jul 9, 2013

Hey,

I just updated my vendors for the latest SonataAdminBundle and therefore also the BlockBundle was checked out. Trying to build the cache I'm getting this weird error:

PHP Fatal error: Can't inherit abstract function Twig_ExtensionInterface::getName() (previously declared abstract in Symfony\Component\Templating\Helper\HelperInterface) in /usr/share/iserv/symfony/vendor/sonata-project/block-bundle/Sonata/BlockBundle/Twig/Extension/BlockExtension.php on line 17

I don't understand the message as it's implying that one abstract class extends a method from its parent abstract class.

Edit: After another look I found that both Twig_ExtensionInterface and the inherited Symfony\Component\Templating\Helper\HelperInterface require a getName() method.

Cheers
Matthias

@dantleech
Copy link
Contributor

I have made a PR to fix this #83

@rande rande closed this as completed in #83 Jul 11, 2013
@sunviwo
Copy link

sunviwo commented Jul 12, 2013

Using this PR results in another error in SonataAdminBundle. Trying to access your admin dashboard returns this error: An exception has been thrown during the rendering of a template ("Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Sonata\BlockBundle\Templating\Helper\BlockHelper' does not have a method 'renderBlock' in C:\wamp\www\Project\app\cache\dev\twig\16\5f\1b0eed585d7af7065254af4c935d.php line 54") in SonataAdminBundle:Core:dashboard.html.twig at line 21.

@sunviwo
Copy link

sunviwo commented Jul 12, 2013

Sorry, I did not know it was merged. Everything is fine.

@broncha
Copy link

broncha commented Jul 19, 2013

I still get this exception in production while

php app/console cache:warmup --env=prod --no-debug

PHP Fatal error:  Can't inherit abstract function Twig_ExtensionInterface::getName() (previously declared abstract in Symfony\Component\Templating\Helper\HelperInterface) in /var/www/html/shared/vendor/sonata-project/block-bundle/Sonata/BlockBundle/Twig/Extension/BlockExtension.php on line 17

@mmenozzi
Copy link

mmenozzi commented Aug 5, 2013

Me too...

php app/console cache:warmup --env=prod --no-debug

PHP Fatal error:  Can't inherit abstract function Twig_ExtensionInterface::getName() (previously declared abstract in Symfony\Component\Templating\Helper\HelperInterface) in /home/placemart/app_deploy/releases/20130805074038/vendor/sonata-project/block-bundle/Sonata/BlockBundle/Twig/Extension/BlockExtension.php on line 17

@buskaiwa2006
Copy link

I just installed the Sonata Project Admin bundle and after clearing the cache, I get the following error message:

FatalErrorException: Compile Error: Can't inherit abstract function Twig_ExtensionInterface::getName() (previously declared abstract in Symfony\Component\Templating\Helper\HelperInterface) in C:\www\test4\vendor\sonata-project\block-bundle\Sonata\BlockBundle\Twig\Extension\BlockExtension.php line 17

This only happens after I install the bundle. I was able to clear cache with no error prior to installing the bundle. Not sure what to do, but obviously cannot use the bundle if this error exists. Any help?

@rmsint
Copy link
Contributor

rmsint commented Aug 6, 2013

Not sure what happens in your case, I have seen discussions about this but it should be solved by now. Are you sure you run the latest code?

@rande
Copy link
Member

rande commented Aug 6, 2013

The issue is coming from php version < 5.3.8 where one class implements 2 interfaces which hold the same method name. The issue has been fixed in the master branch.

I will create a new tag ASAP

@buskaiwa2006
Copy link

Thanks. I am running the most recent code. Just a note that I was able to install the sonata-sandbox with no problem.

@anthonymartin
Copy link

This issue still persists for me.

I have the following installed:

    "sonata-project/admin-bundle": "*",
    "sonata-project/doctrine-orm-admin-bundle": "*",

@czarcar
Copy link

czarcar commented Aug 18, 2013

Can't inherit abstract function Twig_ExtensionInterface::getName(): Have this error on deployment server. Error does not exist on dev box. Using same code including composer.lock.

Code works on: PHP 5.3.10-1ubuntu3.6
Code fails on: PHP 5.3.3 (Redhat)

@rande
Copy link
Member

rande commented Aug 19, 2013

@czarcar this has been fixed on 2.2.6, update your dependencies

@czarcar
Copy link

czarcar commented Aug 19, 2013

Thank you. FYI upgraded PHP on server last night to 5.3.27 problem went away.

@jribeiro
Copy link

Just updated to Sonata/BlockBundle 2.2.6 and I still get this problem. I'm on PHP 5.4.4. Any idea?

Error: Call to undefined method Sonata\BlockBundle\Twig\Extension\BlockExtension::renderBlock() in app/cache/dev/classes.php line 12424

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