View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
13002Bug reportsPluginspublic2017-12-13 08:03
Reporterasshank Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionno change required 
Product Version2.7x.x 
Summary13002: beforeQuestionRender mandatory text not set
Description

The beforeQuestionRender event can't manage the mandatory text (QUESTION_MANDATORY).
It 's the only string that is not 'get' properly after the plugin.
See line in
SurveyRuntimeHelper.php
$aReplacement['QUESTION_MANDATORY'] = $event->get('mandatory',$aReplacement['QUESTION_MANDATORY']);

This should be (imho)
$aReplacement['QUESTION_MANDATORY'] = $event->get('mandatory');

Steps To Reproduce

Make use of this event

Additional Information

bug is applicable up to the latest lime 3

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)171207
I will donate to the project if issue is resolvedNo
Browser-
Database type & version-
Server OS (if known)-
Webserver software & version (if known)-
PHP Version-

Users monitoring this issue

There are no users monitoring this issue.

Activities

asshank

asshank

2017-12-10 12:37

reporter   ~45273

I now think this 'QUESTION_MANDATORY' is obsolete and replaced by 'QUESTION_MAN_MESSAGE'
But I'm not sure!

DenisChenu

DenisChenu

2017-12-11 15:54

developer   ~45275

$aReplacement['QUESTION_MANDATORY'] = $event->get('mandatory',$aReplacement['QUESTION_MANDATORY']); is :

If $event->get('mandatory') is null then : take $aReplacement['QUESTION_MANDATORY'].

If you put $event->set('mandatory',"") : it's OK in 2.72 for example.

DenisChenu

DenisChenu

2017-12-11 16:33

developer   ~45279

Be more clear : in 2.50 and up
mandatory : <i class="mandatory-icon"></i>
man_message : This question is mandatory
valid_message : "need to be up to 0" (for example : it's all lines done by ExpressionManager).

DenisChenu

DenisChenu

2017-12-11 16:46

developer   ~45281

For translation , it's more easy in 3.0, but not really complex in 2.7X too

1: add the translation : https://framagit.org/SondagePro-LimeSurvey-plugin/smtpByUser/blob/master/smtpByUser.php#L127
2: use the translation : https://framagit.org/SondagePro-LimeSurvey-plugin/smtpByUser/blob/master/smtpByUser.php#L118

asshank

asshank

2017-12-11 16:53

reporter   ~45282

Tnx Denis.. I will look into this.
The string has to be in de .po the get it translated thought.. And this one is not : 'You have to agree'
Nice function to get the language...

DenisChenu

DenisChenu

2017-12-11 18:08

developer   ~45283

Yes : the string in your plugin :
$this->_translate("You have to agree") is the default string if : language didn't exist OR if string don't exist in language :).

I hope to find time to allow it via DB too …

DenisChenu

DenisChenu

2017-12-11 19:18

developer   ~45285

gT : limesurvey translation

DenisChenu

DenisChenu

2017-12-12 18:19

developer   ~45289

Can we close this one ?

asshank

asshank

2017-12-12 18:23

reporter   ~45290

yep, Let's see what 3.0 brings!

Issue History

Date Modified Username Field Change
2017-12-09 21:57 asshank New Issue
2017-12-10 12:37 asshank Note Added: 45273
2017-12-11 15:54 DenisChenu Note Added: 45275
2017-12-11 16:33 DenisChenu Note Added: 45279
2017-12-11 16:33 DenisChenu Note View State: 45279: public
2017-12-11 16:46 DenisChenu Note Added: 45281
2017-12-11 16:53 asshank Note Added: 45282
2017-12-11 18:08 DenisChenu Note Added: 45283
2017-12-11 19:18 DenisChenu Note Added: 45285
2017-12-12 18:19 DenisChenu Note Added: 45289
2017-12-12 18:23 asshank Note Added: 45290
2017-12-13 08:03 DenisChenu Assigned To => DenisChenu
2017-12-13 08:03 DenisChenu Status new => closed
2017-12-13 08:03 DenisChenu Resolution open => no change required