Open Uncommonly opened 4 years ago
You can remove the Twig version from Gantry and it should just work (you may need 5.5 branch if the main release has issues), please contact me if it doesn't work.
However, the themes may need some minor tweaks in their twig in order to make them work, though the changes are really minor and easy to do.
No idea how to do that. Could you be more specific please? I’m using latest Gantry version with Reiko. Thanks.
Delete or rename folder libraries/gantry5/vendor/twig
.
I know I've fixed all the compatibility issues with future Twig versions, but as I said, I don't know if those changes have been released or not. Let's try it out.
That didn't work at all. Same errors on forum page and blank page everywhere else.
I'm on a vacation for 2 weeks with no possibility to test this one right now.
Will have to wait you until you get back then. Enjoy your holiday. :)
Bump.
Any movement here?
Sorry for the delay. I was finally able to verify this bug. Gantry uses Twig 1
where the latest phpBB3 versions use Twig 2
.
In Gantry HtmlDocument::escape()
method relies on Twig 1 methods, which do not exist in Twig 2 anymore.
@Uncommonly @Kerveros Please test if installing CI version from the Gantry site + deleting vendor/twig again solves the issue.
No, it doesn't fix the problem. The only fix that applies to this is manually updating twig in Gantry which doesn't really solve the issue, because on every update that is released after, just rolls back the old twig in Gantry. Just include latest twig in next Gantry update, please?
Oh, I forgot to say that you'd still need to remove twig from the vendor folder.
Unfortunately, I cannot update the Twig version without version bump and a big warning because it breaks a lot of sites. Twig 2 also requires PHP 7.1 and Gantry has still way too many sites running on older versions.
PHP 5 in 2020? Cmon guys :>
Attaching manually updated twig. That's the only way to get working both Gantry and p8pbb. Works without any issues for about month now.
Yea... I know. If it was my choice, I would only support PHP 7.3 or later. We are going to ramp up the version to 5.6.20 soon, as it is the minimum requirement for WP. I just wish Joomla would do the same, it's still supporting PHP 5.3.10!
The best way to support phpBB with Gantry would be to ensure that only a single version of Twig is being loaded. This means removing the folder from the vendor or doing some tricks in the autoloader to omit twig when p8pbb (or something else using twig) is active.
Can you test what happens if you just remove the folder? Does it break Gantry somewhere or does p8pbb autoload twig all the time?
No changes when folder being deleted. Same errors being thrown away.
Did you mean that there are errors with folder deleted? And no errors when you use twig 2?
Yes mate. :)
Hmm, OK. So it looks like PhpBB loads Twig only when you're using the forum. Thanks for the info!
I have the same problem as well. Replacing Twig 1 with Twig 2 in gantry5 library has fixed it, but I will have to reapply this every time I update Gantry?
Up. 8 months later, Twig in Gantry is still out of date -.-
I hear that Gantry 5.6 is in the making with minimum PHP 7.2 requirement (https://github.com/gantry/gantry5/issues/2789). Does this mean we can foresee a Twig2 integration then too which eliminates this problem for good? Meaning automatic updates running and no more CSS issues when using the p8pbb bridge?
Yeah, I have already added some logic to allow to switch between Twig versions. I may need to do the same for Twig 1/2 as some of the old themes may not work without changes in Twig 2, we could at least have the option to choose which one to use.
If the option would exist, that would be enough I suppose. Any timings on this release? I know, this is most of the time the forbidden question. But just roughly speaking. This year or 2022.
You have to remember that Twig 1 is still maintained and receives all the fixes. Also, there's already Twig 3, too.
1) Twig 1: indeed. No problem or issues there if the option to choose is there. 2) Indeed yes. But that would be a bridge too far now since both Joomla en the p8pbb plugin still uses Twig 2 now. I don't know which version of Twig will be used in Joomla 4, but if this is going to be Twig 3 then I'm quite certain the p8pbb plugin will follow suite quite quickly.
More then a year has gone by and just wanted to know what's the situation now, since I've seen an update in p8pbb stating that compatibility with Gantry5 was 'solved'.
Everything between Gantry and p8pbb work flawless until when someone wants to login into their profile from Joomla side ( using login menu/page from phpBB is OK ). I got the follwing error when logged in:
After refresh on the page web site returns "Warning. The security token did not match. The request was aborted to prevent any security breach. Please try again.".. in addition :)
And also the following when tryed to access forum page:
Regarding to the developers of p8pbb, it's Gantry issue because it's using older Twig version than phpBB which is using newer.