Has anyone run across and solved the TWIG version problem when using Breakdance to theme your site and Metabox views that contain queries? The problem is that Breakdance and Metabox both use TWIG and they are different versions. The version that Breakdance uses appears to load last and therefore the version that gets used by Metabox. But the args that Metabox passes to the query are different than how TWIG from Breakdance wants them causing any page using that view to crash. The following simple query throws an exception (note that this query is one that I use on most of the sites I create and works fine on the rest and none of them are running Breakdance):
% set args = {
post_type: 'exhibitor',
post_status : 'publish',
'posts_per_page':-1,
}
%}
{% set a = get_posts( args ) %}
the exception that is created is:
PHP Fatal error: Uncaught TypeError: twig_get_attribute(): Argument #1 ($env) must be of type Breakdance\Lib\Vendor\Twig\Environment, eLightUp\Twig\Environment given, called in /home/sites/4a/7/7ed65315fb/public_html/wp-content/plugins/meta-box-aio/vendor/elightup/twig/Twig/Environment.php(358) : eval()'d code on line 42 and defined in /home/sites/4a/7/7ed65315fb/public_html/wp-content/plugins/breakdance/plugin/lib/mozart-scoped-psr4/Twig/Extension/CoreExtension.php:1433
I have a support ticket in with Breakdance but so far they have no solution. I really want to use Breakdance but for me this is a deal breaker if it can't be solved. In the exception you can see that the error is generated in the Breakdance version of TWIG.
I am going to check with TWIG to see how they 'expect' args to be passed, I might be able to tweak the args enough to make both players happy.
Thanks,
Jim