View Issue Details

IDProjectCategoryView StatusLast Update
15446Bug reports[All Projects] Survey editingpublic2020-01-13 14:45
Reportertpartner Assigned Tocdorin  
PrioritynoneSeveritymajor 
Status closedResolutionreopened 
Product Version4.0.0-RC6 
Target VersionFixed in Version 
Summary15446: Custom Twig extensions do not work
Description

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.

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.0.0-RC6
I will donate to the project if issue is resolvedNo
BrowserN/A
Database & DB-Versionmysqlnd 5.0.12
Server OS (if known)Windows 10
Webserver software & version (if known)Apache/2.4.39 (Win64)
PHP Version7.3.7

Activities

tpartner

tpartner

2019-10-22 20:01

developer  

bug_11_backend.png (28,848 bytes)
bug_11_backend.png (28,848 bytes)
bug_11_frontend.png (40,626 bytes)
bug_11_frontend.png (40,626 bytes)
MyTest_Twig_Extension.zip (2,053 bytes)
cdorin

cdorin

2019-11-28 16:35

manager   ~54880

It will be part of the next round of bugs fixing. thx for report!

nietzschean

nietzschean

2019-12-17 15:49

developer   ~55056

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=29288

tpartner

tpartner

2019-12-17 18:49

developer   ~55061

Last edited: 2019-12-17 19:40

View 2 revisions

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.

lime_release_bot

lime_release_bot

2019-12-19 17:21

administrator   ~55101

Fixed in Release 3.21.3+191219

tpartner

tpartner

2019-12-19 18:37

developer   ~55102

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).

tpartner

tpartner

2019-12-19 18:40

developer   ~55103

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.



3.21.3_frontend.png (86,613 bytes)
3.21.3_frontend.png (86,613 bytes)
4.0.0-RC12_backend.png (63,689 bytes)
4.0.0-RC12_backend.png (63,689 bytes)
4.0.0-RC12_frontend.png (63,453 bytes)
4.0.0-RC12_frontend.png (63,453 bytes)
p_teichmann

p_teichmann

2020-01-10 17:35

administrator   ~55208

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.

tpartner

tpartner

2020-01-10 17:54

developer   ~55210

Sorry Patrick, my mistake, yes it does work as expected.

cdorin

cdorin

2020-01-10 18:16

manager   ~55211

Ok, shall I mark it as closed and solved then?

tpartner

tpartner

2020-01-10 18:49

developer   ~55212

Unless @p_teichmann has anything to add, yes please.

p_teichmann

p_teichmann

2020-01-13 12:36

administrator   ~55218

no please close it

Related Changesets

LimeSurvey: master 766a3944

2019-12-17 14:16:12

nietzschean

Details Diff
Fixed issue 15446: Custom Twig extensions do not work Affected Issues
15446
mod - third_party/Twig/ETwigViewRenderer.php Diff File

Issue History

Date Modified Username Field Change
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
2019-12-17 15:49 nietzschean Changeset attached => LimeSurvey master 766a3944
2019-12-17 15:49 nietzschean Note Added: 55056
2019-12-17 15:49 nietzschean Assigned To cdorin => nietzschean
2019-12-17 15:49 nietzschean 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 nietzschean => 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