Skip Navigation

[Resolved] Error in toolset-common twig_extensions

This thread is resolved. Here is a description of the problem and solution.

Problem: Fatal error because of Twig dependencies.

Fatal error: Uncaught TypeError: Argument 1 passed to Twig\Environment::addFunction() must be an instance of Twig\TwigFunction, string given

Solution: Update to Types 3.3.3

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 10 replies, has 3 voices.

Last updated by Mario 5 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1283339

I am trying to activate newest types plugin and have some dependency problems.

I tried to access admin-page from toolset, for example "Dashboard".

I get an Error, because toolset uses another version of Twig Library.

Fatal error: Uncaught TypeError: Argument 1 passed to Twig\Environment::addFunction() must be an instance of Twig\TwigFunction, string given, called in ...\htdocs\wp-content\plugins\types\vendor\toolset\toolset-common\utility\gui-base\twig_extensions.php on line 36 and defined in ..\htdocs\wp-content\plugins\ob-common\vendor\twig\twig\src\Environment.php on line 852

I am using newer version of Twig with composer "twig/twig": "^2.7".

Any ideas how to solve this? Thanks in advance.

#1283391

I'm not sure about that but I can ask my developers for some advice. Please stand by and I will get some feedback for you.

#1283493

My 2nd tier support team asked me to find out if this version of Twig is a dependency of your own, or a dependency of another theme or plugin? If so, which one?

#1283691

Thank you, Christian.
This is a plugin, developed by my own.
Using the newest version of Twig 2.11.3 (hidden link, hidden link).
Same like toolset, i am using composer and its classloader. Never had any problems with any other plugins or themes.

Toolset uses obviously the older Twig version 1.32.0 and some deprecated functions. If i switch my Twig version back to same 1.32.0 it works fine.
Would it be possible for toolset to deliver it with newer twig-version?

#1285005

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mario,

Thank you for your patience, Christian is currently out today, however I checked on the escalated thread for this and it seems our development team has identified the issue and are working on fixing it.

Currently there isn't any workaround from our side but it will definitely be updated.

Thanks,
Shane

#1285653

Thanks Shane. Mario, I will keep this ticket updated as I receive more information from our developers.

#1285673

ok, thanks so far.

#1296997

Our developers have let me know this will be resolved in Types 3.3.4, which is still in development. I will keep you updated here when I have a release date available.

#1297041

good news. thank you Christian.

#1303091

Sorry for the miscommunication, this issue should be resolved in Types 3.3.3 which has already been released. Please let me know if the issue is not completely resolved after updating all Toolset plugins to the latest versions.

#1305209

My issue is resolved now. Thank you!