Conflict with other plugins that use twig
-
Requesting that 2FAS Light be updated with the latest version of the twig library. Conflicts causing fatal errors can be created when “two plugins both include Twig library, but a different version of it”. (a paraphrased quote from the GitHub thread included in the URL above)
I think I’m seeing this now as an Uncaught TypeError with 2FAS Light (which uses twig 1.33.2, from April 2017) and Meta Box Builder (which uses the latest version of twig 1.42.2, from June 2019). When I have both enabled, I immediately get a fatal error, and need to enter recovery mode to disable one of the plugins. Using one without the other is fine, either way. But this will be a larger issue with other plugins that may make use of twig.
An error of type E_ERROR was caused in line 56 of the file /home/user/site.com/wp-content/plugins/meta-box-aio/vendor/meta-box/meta-box-builder/vendor/twig/twig/src/Lexer.php. Error message: Uncaught TypeError: Argument 1 passed to Twig\Lexer::__construct() must be an instance of Twig\Environment, instance of Twig_Environment given, called in /home/user/site.com/wp-content/plugins/2fas-light/vendor/twig/twig/lib/Twig/Environment.php on line 650 and defined in /home/user/site.com/wp-content/plugins/meta-box-aio/vendor/meta-box/meta-box-builder/vendor/twig/twig/src/Lexer.php:56 Stack trace: #0 /home/user/site.com/wp-content/plugins/2fas-light/vendor/twig/twig/lib/Twig/Environment.php(650): Twig\Lexer->__construct(Object(Twig_Environment)) #1 /home/user/site.com/wp-content/plugins/2fas-light/vendor/twig/twig/lib/Twig/Environment.php(750): Twig_Environment->tokenize(Object(Twig\Source)) #2 /home/user/site.com/wp-content/plugins/2fas-light/vendor/twig/twig/lib/Twig/Environment.php(447): Twig_Environment->compileSource(Object(Twig\Source)) #3 /home/user/site.com/wp-content/plugins/2fas-light/vendor/twig/twig/lib/Twig/Environment.ph
Manually updating 2FAS Light myself with the latest version of twig didn’t fix the conflict, as something in 2FAS Light may be making use of code that is now deprecated in the latest version of twig.
If any other plugins get installed that use a newer version of twig, the newer version supersedes the old, causing the fatal error. Seems to be related to the older version of twig 2FAS Light is using. But this is just a guess.
The page I need help with: [log in to see the link]
- The topic ‘Conflict with other plugins that use twig’ is closed to new replies.