View Issue Details

This bug affects 1 person(s).
 18
IDProjectCategoryView StatusLast Update
13516Bug reportsSurvey editingpublic2019-05-29 16:39
Reportertpartner Assigned Todominikvitt 
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.5.x 
Fixed in Version3.17.x 
Summary13516: Cannot access localized (i18n) values for a custom question attribute
Description

I create a custom question attribute in a custom question theme and give it a tag <i18n>true</i18n>. This results in language-dependent attribute fields in the admin view. So far, so good (attached capture-6.png & capture-7.png) .

However, when I try to access the value of that attribute in a twig file (attached capture-8.png), it returns the base-language value regardless of survey language (attached capture-4.png & capture-5.png).

Also attached a custom question theme and test survey.

TagsNo tags attached.
Attached Files
capture-6.png (15,324 bytes)   
capture-6.png (15,324 bytes)   
capture-7.png (13,500 bytes)   
capture-7.png (13,500 bytes)   
capture-4.png (24,883 bytes)   
capture-4.png (24,883 bytes)   
capture-5.png (24,428 bytes)   
capture-5.png (24,428 bytes)   
autoComplete.zip (385,265 bytes)
capture-8.png (6,480 bytes)   
capture-8.png (6,480 bytes)   
Bug heat18
Complete LimeSurvey version number (& build)3.5.1
I will donate to the project if issue is resolvedNo
BrowserN/A
Database type & versionmysqlnd 5.0.12-dev
Server OS (if known)Windows 10
Webserver software & version (if known)Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.9
PHP Version7.1.9

Relationships

related to 14228 confirmed Feature requests Survey and Question Theme need more information 

Users monitoring this issue

jelo, DenisChenu

Activities

DenisChenu

DenisChenu

2018-03-22 10:26

developer   ~47173

I like the new question type ;)

LouisGac

LouisGac

2018-03-22 10:28

developer   ~47174

same, love it.
I'm working on the CU this week. We'll make the upgrade from 2.73 available
I'll fix the question themes problems next week

tpartner

tpartner

2018-03-22 12:18

partner   ~47186

@DenisChenu, @LouisGac, thanks - please don't judge me yet - it's a work-in-progress. :)

DenisChenu

DenisChenu

2018-05-15 15:43

developer   ~47592

Last edited: 2018-05-15 15:44

Core solution is … …
here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/QuestionAttribute.php#L216

And have already some (fixed) issue : https://github.com/LimeSurvey/LimeSurvey/blob/c0779ad0f1969e530ea22cdb5a6dc1ea4b0c9f9d/application/models/QuestionAttribute.php#L225

ollehar

ollehar

2018-07-10 14:58

administrator   ~48486

Is this still being worked on?

tpartner

tpartner

2018-08-14 13:31

partner   ~48778

Doesn't look like it.

LouisGac

LouisGac

2018-08-14 14:23

developer   ~48779

yes, already done and about to be bpushed ;-)

tpartner

tpartner

2018-08-23 12:54

partner   ~48864

This is still not working in the attached survey after updating to 3.14.6.

LouisGac

LouisGac

2018-08-23 12:59

developer   ~48865

still not pushed
it's a huge change behind it (XML config for each question type to replace the old attribute helper)
it's already done but will be pushed when the new feature behind it will be finished, so during the month of september.
we'll also provide a clean way to hide the question attributes (right now the solution to do that is a bit hackish)

DenisChenu

DenisChenu

2018-10-26 23:54

developer   ~49457

@LouisGac : any new on this ?

Maybe https://github.com/LimeSurvey/LimeSurvey/blob/c0779ad0f1969e530ea22cdb5a6dc1ea4b0c9f9d/application/models/QuestionAttribute.php#L164 must get question theme attribute too …

And for hidden : it's really easy since it's only one default (think 'visible', or 'adminvisble' => true) + one return in the view …

DenisChenu

DenisChenu

2018-10-27 11:26

developer   ~49460

I think we must sen,d more information in doRender fundtion in qanda :

  1. Always send qid
  2. Always send all question attribute

Currently : we don't have anything in LSETwigViewRenderer->renderQuestion , i don't find a way to know current qid …

Mazi

Mazi

2019-05-13 09:08

updater   ~51908

@markusfluer, are you planning to add such a question type to LS 4.0? Doesn't look overly complex and it would be a great benefit for others.

tpartner

tpartner

2019-05-13 12:59

partner   ~51920

More to the point, when is the bug going to be fixed? It has been open for more than a year!

@DenisChenu, why was the target version changed? This needs to be fixed for 3.x.

DenisChenu

DenisChenu

2019-05-13 13:56

developer   ~51922

@tparner :

it's a huge change behind it (XML config for each question type to replace the old attribute helper)
it's already done but will be pushed when the new feature behind it will be finished, so during the month of september.
we'll also provide a clean way to hide the question attributes (right now the solution to do that is a bit hackish)

I can reset to 3.X , but i'm sure this part is only for 4.X

tpartner

tpartner

2019-05-13 14:13

partner   ~51923

Thanks Denis but, again, my point is when will this be fixed for 3.x?

3.x is to be supported until at least the end of this year and this bug renders the creation of multi-lingual custom question themes virtually impossible.

DenisChenu

DenisChenu

2019-05-13 14:30

developer   ~51926

Since i'm not the one assigned …

Else i think in master : getCurrentAttribute($qid,'attributename') in twig function can do the trick
Taking current langage only attribute value.

dominikvitt

dominikvitt

2019-05-14 17:38

developer   ~51935

https://github.com/LimeSurvey/LimeSurvey/commit/b34f839d202ba0061412b5bd313d08e1d34d3309

tpartner

tpartner

2019-05-14 18:08

partner   ~51936

Thanks @dominikvitt.

c_schmitz

c_schmitz

2019-05-29 16:12

administrator   ~52181

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

c_schmitz

c_schmitz

2019-05-29 16:39

administrator   ~52233

Version 3.17.4+190529 released

Related Changesets

LimeSurvey: master b34f839d

2019-05-14 17:35:28

Dominik Vitt

Details Diff
Fixed issue 13516: Cannot access localized (i18n) values for a custom question attribute Affected Issues
13516
mod - application/models/QuestionTemplate.php Diff File

Issue History

Date Modified Username Field Change
2018-03-21 22:17 tpartner New Issue
2018-03-21 22:17 tpartner Status new => assigned
2018-03-21 22:17 tpartner Assigned To => LouisGac
2018-03-21 22:17 tpartner File Added: capture-6.png
2018-03-21 22:17 tpartner File Added: capture-7.png
2018-03-21 22:17 tpartner File Added: capture-4.png
2018-03-21 22:17 tpartner File Added: capture-5.png
2018-03-21 22:17 tpartner File Added: limesurvey_survey_476635.lss
2018-03-21 22:17 tpartner File Added: autoComplete.zip
2018-03-21 22:22 tpartner Description Updated
2018-03-21 22:23 tpartner File Added: capture-8.png
2018-03-22 10:26 DenisChenu Note Added: 47173
2018-03-22 10:28 LouisGac Note Added: 47174
2018-03-22 12:18 tpartner Note Added: 47186
2018-05-15 15:43 DenisChenu Note Added: 47592
2018-05-15 15:44 DenisChenu Note Edited: 47592
2018-05-23 13:08 LouisGac Assigned To LouisGac => dominikvitt
2018-05-28 12:55 dominikvitt Assigned To dominikvitt => LouisGac
2018-07-10 14:58 ollehar Note Added: 48486
2018-08-14 13:31 tpartner Note Added: 48778
2018-08-14 14:23 LouisGac Note Added: 48779
2018-08-23 12:54 tpartner Note Added: 48864
2018-08-23 12:59 LouisGac Note Added: 48865
2018-10-26 23:54 DenisChenu Note Added: 49457
2018-10-27 11:09 DenisChenu Issue Monitored: DenisChenu
2018-10-27 11:26 DenisChenu Note Added: 49460
2018-10-30 15:12 DenisChenu Target Version 3.5.x => 4.0.0dev
2018-11-08 18:57 DenisChenu Relationship added related to 14228
2019-05-13 09:08 Mazi Note Added: 51908
2019-05-13 12:59 tpartner Note Added: 51920
2019-05-13 13:56 DenisChenu Note Added: 51922
2019-05-13 13:56 DenisChenu Target Version 4.0.0dev =>
2019-05-13 14:13 tpartner Note Added: 51923
2019-05-13 14:30 DenisChenu Note Added: 51926
2019-05-14 14:47 LouisGac Assigned To LouisGac => dominikvitt
2019-05-14 16:17 jelo Issue Monitored: jelo
2019-05-14 17:38 dominikvitt Status assigned => resolved
2019-05-14 17:38 dominikvitt Resolution open => fixed
2019-05-14 17:38 dominikvitt Fixed in Version => 3.17.x
2019-05-14 17:38 dominikvitt Note Added: 51935
2019-05-14 18:08 tpartner Note Added: 51936
2019-05-29 16:12 Changeset attached => LimeSurvey master b34f839d
2019-05-29 16:12 c_schmitz Note Added: 52181
2019-05-29 16:39 c_schmitz Note Added: 52233
2019-05-29 16:39 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing