View Issue Details

This issue affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
07791Bug reportsSurvey takingpublic2013-04-24 11:06
Reporterandrewb Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionduplicate 
Product Version2.00+ 
Summary07791: Issues with rendering Time questions with Date/Time Question Type
Description

There appears to be an issue with rendering a question with Date/Time.

I have a simple Date/Time question with the value set to: H:i, set to 30 min increments.

But when the survey is rendered out, the Minute part isn't working, so I started looking into this and noticed that when the question renders out that it appears like this: (The full rendering is found under "Additional Information".

<input type="text" onchange="checkconditions(this.value, this.name, this.type)" alt="Answer" maxlength="10" "="" h:i");="" value="date(" id="answer298662X1X4" style="display: none" name="298662X1X4" size="10" class="text">

The value field gets all screwed up, because the survey is rendering two sets of double quotes.

My thoughts on the issue and where the problem is can be found below in the Additional Information section.

Steps To Reproduce

First setup a question like:
Type: Date/Time
Display dropdown boxes: Yes
Minute step interval: 30
Date/Time format: H:i

Run the survey.

Additional Information

Thoughts on the issue.

I found that in the file:
/application/helpers/qanda_helper.php on line 2286 the following code:

$answer .= '<input class="text" type="text" size="10" name="'.$ia[1].'" style="display: none" id="answer'.$ia[1].'" value="'.$SESSION['survey'.Yii::app()->getConfig('surveyID')][$ia[1]].'" maxlength="10" alt="'.$clang->gT('Answer').'" onchange="'.$checkconditionFunction.'(this.value, this.name, this.type)" />

';

When I created a dump of the $_SESSION variable I found the following.

[298662X1X4] => Array
(
[fieldname] => 298662X1X4
[type] => D
[sid] => 298662
[gid] => 1
[qid] => 4
[aid] =>
[title] => Time
[question] => Time
[group_name] => Call
[mandatory] => Y
[hasconditions] => N
[usedinconditions] => N
[questionSeq] => 4
[groupSeq] => 0
[defaultvalue] => date("H:i");
[relevance] => 1
[grelevance] =>
[preg] =>
[other] => N
[help] =>
)

The default value stood out to me of [defaultvalue] => date("H:i");

This would cause the following to be rendered:

value="date("H:i");"

Which of course closes the tag too quickly.

I'm yet to find where that part is generated from.

Full Sample Question Rendering:

<td class="questiontext">
<span class="asterisk">*</span><span class="qnumcode"> </span>Time
<!--<span class="questionhelp"></span>-->

            <span id="vmsg_4" class="questionhelp"></span>

            <div class="answer">
            <p class="question answer-item dropdown-item date-item"><label class="hide" for="hour298662X1X4">Hour</label><select class="hour" name="hour298662X1X4" id="hour298662X1X4"><option value="">Hour</option><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select>:<label class="hide" for="minute298662X1X4">Minute</label><select class="minute" name="minute298662X1X4" id="minute298662X1X4">

<option value="">Minute</option><option value="0">00</option><option value="30">30</option></select><input type="text" onchange="checkconditions(this.value, this.name, this.type)" alt="Answer" maxlength="10" "="" h:i");="" value="date(" id="answer298662X1X4" style="display: none" name="298662X1X4" size="10" class="text">

<input type="hidden" value="298662X1X4" name="qattribute_answer[]">
<input type="hidden" name="qattribute_answer298662X1X4" id="qattribute_answer298662X1X4">
<input type="hidden" value="H:i" id="dateformat298662X1X4">
</div>
</td>

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)130406
I will donate to the project if issue is resolvedNo
BrowserFirefox
Database type & versionMySQL
Server OS (if known)Linux
Webserver software & version (if known)Litespeed Server
PHP Version5.3
Git branch / Pull Request URL

Relationships

duplicate of 07792 closedc_schmitz Date/Time Questions not supporting/recording 'i' type minutes with dropdown boxes 

Users monitoring this issue

mfaber

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2013-04-23 10:11 andrewb New Issue
2013-04-23 11:27 mfaber Issue Monitored: mfaber
2013-04-24 11:06 c_schmitz Relationship added duplicate of 07792
2013-04-24 11:06 c_schmitz Status new => closed
2013-04-24 11:06 c_schmitz Assigned To => c_schmitz
2013-04-24 11:06 c_schmitz Resolution open => duplicate