FriendsOfSymfony / FOSTwitterBundle

UNMAINTAINED. Please use HWIOAuthBundle as a replacement for FOSTwitterBundle.
http://friendsofsymfony.github.com/
145 stars 38 forks source link

Twig Extension : Bad overrided function #28

Closed sescandell closed 12 years ago

sescandell commented 12 years ago

Switching to Twig 1.8.0, I got the following error :

Twig_Error_Runtime: An exception has been thrown during the compilation of a template ("Catchable Fatal Error: Argument 2 passed to Twig_Environment::addFunction() must implement interface Twig_FunctionInterface, instance of Twig_Filter_Method given, called in /data/projets/project/source/trunk /vendor/twig/lib/Twig/Environment.php on line 962 and defined in /data/projets/project/source/trunk/vendor /twig/lib/Twig/Environment.php line 895") in "ProjectCoreBundle::layout.html.twig".

Exploring the code, I see in TwitterAnywhereExtension class you override the function "getFunctions()" in order to return an array of Twig_Filter_Method objects. I think the right function to override is "getFilters()" instead.

stof commented 12 years ago

no. They should indeed be functions. The appropriate fix is to change them to sue Twig_Function_Method instead of Twig_Filter_Method. Could you send a PR to the v1.0 branch with a fix ?

sescandell commented 12 years ago

Ok. I was wondering if it was the bad function name or the bad objects.

I will find some times to make the PR.

omissis commented 12 years ago

it seems I have the same issue, too.

sescandell commented 12 years ago

Sorry for the delay,

PR sent