Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Lexer / Function & Filter issues when using Twig2 #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

weblogics
Copy link

@weblogics weblogics commented Oct 3, 2017

Twig2 Fixes

  • Due to Twig2 no longer allowing functions or globals to be added after the Lexer is initialised we need to do this prior to initializing the Lexer.
  • Added checks and updated function calls

Tested with twig 2.4.3

Please note

If you're using composer then you will need to comment out the following lines:

if ( !class_exists('ComposerAutoloaderInit') )
    require_once(TWIGGY_ROOT . '/vendor/Twig/lib/Twig/Autoloader.php');
    Twig_Autoloader::register();

Twig2 requires that functions & global variables are added prior to the lexer being initialised, this fix allows us to use Twig2
Twig2 Calls functions and filters with different methods, added checks and updated function calls

Tested with twig 2.4.3
@weblogics weblogics changed the title Fix Lexer issues when using Twig2 Fix Lexer / Function & Filter issues when using Twig2 Oct 3, 2017
@REJack
Copy link

REJack commented Oct 4, 2017

Nice work, I'll adapt your work in my fork 😄, edmundask is no longer actively maintain this project.

@weblogics
Copy link
Author

Cheers buddy, yeah I did tweet Ed a few weeks back as i've been putting off debugging and running through every line of code to see what the issues were with Twig v2.

Are you maintaining this now? I shall bug ed again to transfer the repo to someone else or a group to maintain.

I've got some more functionality to add for custom extensions etc etc

@REJack
Copy link

REJack commented Oct 4, 2017

I maintain not this repo sadly 😄 but i maintain my fork and adding new features to twiggy (like composer/non-composer support over config).
You can look over my v1.0.0 issue here.

It would be awesome if edmundask transfers the repo to someone else or create a group with a new/active group admin 😃 (A group without an active group admin is horrible).

I'll test later your Twig v2 fix and then i merge it to my fork. You can create PR's on my fork too with new changes/enhancements^^

@weblogics
Copy link
Author

weblogics commented Oct 4, 2017 via email

@REJack
Copy link

REJack commented Oct 4, 2017

I did checkout your fork and apply the edits, but couldn’t for some reason check them back in to a new branch.

For this you need write access on my fork 😄,

but you can go on my fork, and then click on "Fork" beside the count then you should create a fork from my fork, if this not works maybe you need to remove the other fork before you can create a new one.

regards REJack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants