Skip to content

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

Open
weblogics wants to merge 4 commits into
edmundask:masterfrom
weblogics:master
Open

Fix Lexer / Function & Filter issues when using Twig2#31
weblogics wants to merge 4 commits into
edmundask:masterfrom
weblogics:master

Conversation

@weblogics

@weblogics weblogics commented Oct 3, 2017

Copy link
Copy Markdown

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

REJack commented Oct 4, 2017

Copy link
Copy Markdown

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

@weblogics

Copy link
Copy Markdown
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

REJack commented Oct 4, 2017

Copy link
Copy Markdown

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

weblogics commented Oct 4, 2017 via email

Copy link
Copy Markdown
Author

@REJack

REJack commented Oct 4, 2017

Copy link
Copy Markdown

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