View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|15446||Bug reports||Survey editing||public||2019-10-22 20:01||2020-01-13 14:45|
|Summary||15446: Custom Twig extensions do not work|
I copied the existing HelloWorld_Twig_Extension file in ./upload/twig/extensions, simply changing all instances of "HelloWorld" with "MyTest", which should have given me access to a new TWIG function MyTest().
The result in the back end is seen in the attached bug_11_backend.png.
The result in the front end for all surveys is seen in bug_11_frontend.png.
I have also attached my test extension file - MyTest_Twig_Extension.zip.
|Tags||No tags attached.|
|Complete LimeSurvey version number (& build)||4.0.0-RC6|
|I will donate to the project if issue is resolved||No|
|Sync to Zoho Project|
|Database & DB-Version||mysqlnd 5.0.12|
|Server OS (if known)||Windows 10|
|Webserver software & version (if known)||Apache/2.4.39 (Win64)|
MyTest_Twig_Extension.zip (2,053 bytes)
It will be part of the next round of bugs fixing. thx for report!
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=29288
Why was the fix committed to master - the problem is in 4.x which (I thought) is develop.
I have pulled version 4.0.0-RC12 and this is still broken.
Fixed in Release 3.21.3+191219
Why is this bug closed? It is still broken in 3.21.3 and in 4.0.0-RC12 (which was where the bug was found).
Please see new screenshots from 3.21.3 and 4.0.0-RC12 after placing the attached extension in /upload/twig/extensions/. In both instances, debug is set to 1.
I just checked this and it works, what i saw is that your php file is called "MyTest_Twig2_Extension" instead of "MyTest_Twig_Extension". The Folder, php class and the "extension-name" inside the xml need to be spelled the same way.
Sorry Patrick, my mistake, yes it does work as expected.
Ok, shall I mark it as closed and solved then?
Unless @p_teichmann has anything to add, yes please.
no please close it
|2019-10-22 20:01||tpartner||New Issue|
|2019-10-22 20:01||tpartner||File Added: bug_11_backend.png|
|2019-10-22 20:01||tpartner||File Added: bug_11_frontend.png|
|2019-10-22 20:01||tpartner||File Added: MyTest_Twig_Extension.zip|
|2019-10-22 20:02||tpartner||Description Updated||View Revisions|
|2019-11-01 17:25||c_schmitz||Category||Survey design => Survey editing|
|2019-11-14 21:33||cdorin||Assigned To||=> cdorin|
|2019-11-14 21:33||cdorin||Status||new => assigned|
|2019-11-28 16:35||cdorin||Note Added: 54880|
||Changeset attached||=> LimeSurvey master 766a3944|
||Note Added: 55056|
||Assigned To||cdorin => user204295|
||Resolution||open => fixed|
|2019-12-17 18:49||tpartner||Note Added: 55061|
|2019-12-17 19:40||tpartner||Note Edited: 55061||View Revisions|
|2019-12-19 17:21||lime_release_bot||Note Added: 55101|
|2019-12-19 17:21||lime_release_bot||Status||assigned => closed|
|2019-12-19 18:37||tpartner||Status||closed => feedback|
|2019-12-19 18:37||tpartner||Resolution||fixed => reopened|
|2019-12-19 18:37||tpartner||Note Added: 55102|
|2019-12-19 18:40||tpartner||File Added: 3.21.3_frontend.png|
|2019-12-19 18:40||tpartner||File Added: 4.0.0-RC12_backend.png|
|2019-12-19 18:40||tpartner||File Added: 4.0.0-RC12_frontend.png|
|2019-12-19 18:40||tpartner||Note Added: 55103|
|2019-12-19 18:40||tpartner||Status||feedback => assigned|
|2019-12-19 19:02||cdorin||Assigned To||user204295 => cdorin|
|2020-01-10 17:35||p_teichmann||Note Added: 55208|
|2020-01-10 17:54||tpartner||Note Added: 55210|
|2020-01-10 18:16||cdorin||Note Added: 55211|
|2020-01-10 18:49||tpartner||Note Added: 55212|
|2020-01-13 12:36||p_teichmann||Note Added: 55218|
|2020-01-13 14:45||cdorin||Status||assigned => closed|