Support Forum
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
Hello Jim,
It could be a compatibility issue with Breakdance, can you please share a copy of this plugin with me? I will inform the development team to check it and see if there is something we can do from our side.
Thanks.
How can I send you the plugin without it being posted to this support ticket? This is a paid for plugin, so I don't want the public to be able to get it and I will need (most likely) to send you the activation code as well.
Feel free to contact me directly via email.
Jim
Thanks, but that contact form does not have a way to attach anything. It's just a text field.
Jim
Hm, I edited my above reply and submitted it, but the edits did not show up. I send a link to download the file and I added a link to this thread in the contact form. I think you can install and use it without the reg code, but if you need it let me know.
Jim
This issue has been resolved in the new version of MB Views and Meta Box AIO.
Let me know if you need anything further.