View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
11527Bug reportsSurvey editingpublic2016-08-29 12:39
ReporterMazi Assigned Tomarkusfluer 
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version2.50.x 
Target Version2.50.xFixed in Version2.50.x 
Summary11527: {QUESTION_VALID_MESSAGE} placeholder gets populated with HTML even if no warning exists
Description

For every question type Limesurvey adds the HTML marked at the attached screenshot after the "question title" and before the "answer-container" DIV.

Problem is that the HTMl block/DIV also gets created even if there is no warning text within the DIV. This is a problem when creating a custom template because it adds additional margin/padding for the element which has no content.

Solution: Only generate the "questionvalidcontainer" DIV if there is some text to show.

Steps To Reproduce

Run any survey with the shipped "default" template.

Additional Information

At former Limesurvey versions one could dynamically add the required DIV for help texts if some text existed by using code like this at the question.pstpl file:
{if(!is_empty(QUESTIONHELP),"<div class='questionhelp'>"+QUESTIONHELP+"</div>","")}

For the new structure the code should be similar, example:
{if(is_empty(QUESTION_VALID_MESSAGE) AND is_empty(QUESTION_MAN_MESSAGE) AND is_empty(QUESTION_FILE_VALID_MESSAGE),"","<div class='row question-wrapper'><div class='col-sm-12 questionvalidcontainer'>"+QUESTION_VALID_MESSAGE+QUESTION_MAN_MESSAGE+QUESTION_FILE_VALID_MESSAGE+"</div></div>")}

...BUT this doesn't work anymore because QUESTION_VALID_MESSAGE now always has some content (the HTML created).

TagsNo tags attached.
Bug heat10
Complete LimeSurvey version number (& build)160804
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL 5
Server OS (if known)Ubuntu
Webserver software & version (if known)Apache 2
PHP Version5.5.9

Users monitoring this issue

sth

Activities

markusfluer

markusfluer

2016-08-08 15:13

administrator   ~40202

The container has to be rendered, for questions that get updated by javascript.
The error messages sometimes are generated over AJAX.
What we may do is to remove padding and margin, so that it is not taking any space if not needed.

Mazi

Mazi

2016-08-08 15:46

updater   ~40204

Thanks for your feedback, Markus. If the container has to be there then it would be nice if the CSS could be adjusted to not create any additional padding/margin.

DenisChenu

DenisChenu

2016-08-10 10:58

developer   ~40224

Last edited: 2016-08-10 10:59

There are an issue in Expression Manager :
If there are no validation, the QUESTION_VALID_MESSAGE return <span id="valid_123"></span>

We have to find where this is tested.

Issue in 2.06 too

PS: container are a template issue : LimeSurvey must be able to use any class/other part in any other template.

markusfluer

markusfluer

2016-08-24 11:20

administrator   ~40421

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

c_schmitz

c_schmitz

2016-08-29 12:39

administrator   ~40551

Version 2.51.0 Build 160829 released

Related Changesets

LimeSurvey: master d7aac39e

2016-08-24 09:18:24

markusfluer

Details Diff
Fixed issue 11527: {QUESTION_VALID_MESSAGE} placeholder gets populated with HTML even if no warning exists Affected Issues
11527
mod - application/helpers/qanda_helper.php Diff File

Issue History

Date Modified Username Field Change
2016-08-08 13:04 Mazi New Issue
2016-08-08 13:04 Mazi Status new => assigned
2016-08-08 13:04 Mazi Assigned To => markusfluer
2016-08-08 15:13 markusfluer Note Added: 40202
2016-08-08 15:42 Mazi Issue Monitored: sth
2016-08-08 15:46 Mazi Note Added: 40204
2016-08-10 10:58 DenisChenu Note Added: 40224
2016-08-10 10:59 DenisChenu Note Edited: 40224
2016-08-24 11:18 markusfluer Status assigned => resolved
2016-08-24 11:18 markusfluer Fixed in Version => 2.5
2016-08-24 11:18 markusfluer Resolution open => fixed
2016-08-24 11:20 markusfluer Changeset attached => LimeSurvey master d7aac39e
2016-08-24 11:20 markusfluer Note Added: 40421
2016-08-29 12:39 c_schmitz Note Added: 40551
2016-08-29 12:39 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2021-08-03 12:38 guest Bug heat 8 => 10