[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.
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".
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?
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?
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.
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.
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.