- Posts: 35
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Date/Time question crashes survey when only one element selected
- RaCMJS
- Topic Author
- Offline
- Junior Member
Less
More
8 years 10 months ago #120537
by RaCMJS
Date/Time question crashes survey when only one element selected was created by RaCMJS
Hi,
I have been using the Date/Time question with the mm/yyyy input format in one of my surveys. It seems like answering only part of the question (e.g., selecting a year without selecting a month) crashes the survey and produces the following error messages:
Did not save
An unexpected error has occurred and your responses cannot be saved.
Your responses have not been lost and have been emailed to the survey administrator and will be entered into our database at a later point.
and on the next page:
Error
We are sorry but your session has expired.
Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.
----
I am using Version 2.05+ Build 150310. I can't make the question mandatory. Is this something that has been experienced by other users? Is there a fix in a later version of Lime? If not, is there a workaround so that a respondent can enter one component without crashing the survey and WITHOUT making the question mandatory?
Thanks!
I have been using the Date/Time question with the mm/yyyy input format in one of my surveys. It seems like answering only part of the question (e.g., selecting a year without selecting a month) crashes the survey and produces the following error messages:
Did not save
An unexpected error has occurred and your responses cannot be saved.
Your responses have not been lost and have been emailed to the survey administrator and will be entered into our database at a later point.
and on the next page:
Error
We are sorry but your session has expired.
Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.
----
I am using Version 2.05+ Build 150310. I can't make the question mandatory. Is this something that has been experienced by other users? Is there a fix in a later version of Lime? If not, is there a workaround so that a respondent can enter one component without crashing the survey and WITHOUT making the question mandatory?
Thanks!
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10613
- Thank you received: 3691
8 years 10 months ago #120556
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Date/Time question crashes survey when only one element selected
Try updating to the latest build. I get this when not answering both parts of the date question - "Please complete all parts of the date!".
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- RaCMJS
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 35
- Thank you received: 1
8 years 10 months ago #120606
by RaCMJS
Replied by RaCMJS on topic Date/Time question crashes survey when only one element selected
Hi Tony,
Thanks, but this does not seem to solve the problem. We upgraded to the latest build and still get the error when only putting in one element of the date. I am attaching the survey we are using to test this (only one question).
The survey seems to work fine when it is NOT active. The validation question pops up when you click the submit button. However, once the survey is active (with a tokens) the survey crashes (the experience described in my original post).
In terms of the error when it's active, the javascript below is failing because the "LEMgseq" variable is not being set to anything.
<!--
var LEMmode='group';
var LEMgseq=;
function ExprMgr_process_relevance_and_tailoring(evt_type,sgqa,type){
if (typeof LEM_initialized == 'undefined') {
LEM_initialized=true;
LEMsetTabIndexes();
}
if (evt_type == 'onchange' && (typeof last_sgqa !== 'undefined' && sgqa==last_sgqa) && (typeof last_evt_type !== 'undefined' && last_evt_type == 'TAB' && type != 'checkbox')) {
last_evt_type='onchange';
last_sgqa=sgqa;
return;
}
last_evt_type = evt_type;
last_sgqa=sgqa;
}
//-->
Do you have any suggestions as to how to fix this?
Many thanks.
Thanks, but this does not seem to solve the problem. We upgraded to the latest build and still get the error when only putting in one element of the date. I am attaching the survey we are using to test this (only one question).
The survey seems to work fine when it is NOT active. The validation question pops up when you click the submit button. However, once the survey is active (with a tokens) the survey crashes (the experience described in my original post).
In terms of the error when it's active, the javascript below is failing because the "LEMgseq" variable is not being set to anything.
<!--
var LEMmode='group';
var LEMgseq=;
function ExprMgr_process_relevance_and_tailoring(evt_type,sgqa,type){
if (typeof LEM_initialized == 'undefined') {
LEM_initialized=true;
LEMsetTabIndexes();
}
if (evt_type == 'onchange' && (typeof last_sgqa !== 'undefined' && sgqa==last_sgqa) && (typeof last_evt_type !== 'undefined' && last_evt_type == 'TAB' && type != 'checkbox')) {
last_evt_type='onchange';
last_sgqa=sgqa;
return;
}
last_evt_type = evt_type;
last_sgqa=sgqa;
}
//-->
Do you have any suggestions as to how to fix this?
Many thanks.
Attachments:
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10613
- Thank you received: 3691
8 years 10 months ago #120629
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Date/Time question crashes survey when only one element selected
I'm sorry, I still cannot reproduce the problem with your attached survey. After activating, if I only select one element of the date and submit, I get an alert "One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid." and then the date question is reset and "Please complete all parts of the date!" is appended to the question text.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- RaCMJS
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 35
- Thank you received: 1
8 years 9 months ago #120664
by RaCMJS
Replied by RaCMJS on topic Date/Time question crashes survey when only one element selected
Seeking more help with this - we tried this on your demo page and it works, but for some reason it is crashing in our environment. We are now thinking that it's a database issue - we use Limesurvey on a Linux/Apache machine with a SQL server for the database. Is there a known issue with dates and this configuration?
Thanks.
Thanks.
The topic has been locked.
- RaCMJS
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 35
- Thank you received: 1
8 years 9 months ago #120666
by RaCMJS
Replied by RaCMJS on topic Date/Time question crashes survey when only one element selected
Just to follow-up: We tested a fresh install of LIME (build 150508) and suspect that the issue may be database related. Basically, we did not experience the issue when the active survey was using MySQL but did experience the issue when using PostgreSQL and MS SQL Server.
A. Works
1. MySQL 5.5.43, Linux Mint 17.1, Apache, PHP 5.5.9
B. Doesn't work
1. PostgreSQL 9.4, Linux Mint 17.1, Apache, PHP 5.5.9 - This is the same setup as the configuration that worked. The only difference being the database used.
2. MS SQL Server 2008, RHEL 6.3, Apache PHP 5.4.39
3. MS SQL Server 2008, Windows 7, IIS, PHP 5.3.28
Any suggestions as to how to deal with this? Our survey has more than 20 date fields - we need to figure out a solution....
A. Works
1. MySQL 5.5.43, Linux Mint 17.1, Apache, PHP 5.5.9
B. Doesn't work
1. PostgreSQL 9.4, Linux Mint 17.1, Apache, PHP 5.5.9 - This is the same setup as the configuration that worked. The only difference being the database used.
2. MS SQL Server 2008, RHEL 6.3, Apache PHP 5.4.39
3. MS SQL Server 2008, Windows 7, IIS, PHP 5.3.28
Any suggestions as to how to deal with this? Our survey has more than 20 date fields - we need to figure out a solution....
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
8 years 9 months ago - 8 years 9 months ago #120670
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Date/Time question crashes survey when only one element selected
What did the logfiles of the database servers show?
And the debugging mode of Limesurvey? And PHP error log?
Perhaps there is a new bug in the database connection part.
www.limesurvey.org/en/forum/installation...ssql-2008-on-windows
Could be a different issue but it might be worth checking.
You should try to check sessions via file and via database.
It might be an issue like this:
bugs.limesurvey.org/view.php?id=9592
And the debugging mode of Limesurvey? And PHP error log?
Perhaps there is a new bug in the database connection part.
www.limesurvey.org/en/forum/installation...ssql-2008-on-windows
Could be a different issue but it might be worth checking.
You should try to check sessions via file and via database.
It might be an issue like this:
bugs.limesurvey.org/view.php?id=9592
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 8 years 9 months ago by jelo.
The topic has been locked.
- aortiz
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
8 years 9 months ago - 8 years 9 months ago #120688
by aortiz
Replied by aortiz on topic Date/Time question crashes survey when only one element selected
When I enabled debugging in Lime, I received the following error:
Error executing query in dbExecuteAssoc:CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting date and/or time from character string.. The SQL statement executed was: UPDATE lime_survey_786677 SET [lastpage]=0, [datestamp]='2015-05-20 08:12:01', [ipaddr]='127.0.0.1', [786677X1192X22328]='INVALID' WHERE ID=28
The part that stands out at me is "[786677X1192X22328]='INVALID'". When you combine that with the javascript variable that's not being set (explained above. "var LEMgseq=;"), it's almost as though the JS is failing and allowing a bad SQL statement to be executed since the date value is "INVALID".
We thought it might be related to the SQL Server connector which is why we replicated the test using PostgreSQL in the same environment of the functional MySQL configuration. If it is a bug in the database connector, then it's affecting both PostgreSQL and SQL Server.
Error executing query in dbExecuteAssoc:CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting date and/or time from character string.. The SQL statement executed was: UPDATE lime_survey_786677 SET [lastpage]=0, [datestamp]='2015-05-20 08:12:01', [ipaddr]='127.0.0.1', [786677X1192X22328]='INVALID' WHERE ID=28
The part that stands out at me is "[786677X1192X22328]='INVALID'". When you combine that with the javascript variable that's not being set (explained above. "var LEMgseq=;"), it's almost as though the JS is failing and allowing a bad SQL statement to be executed since the date value is "INVALID".
We thought it might be related to the SQL Server connector which is why we replicated the test using PostgreSQL in the same environment of the functional MySQL configuration. If it is a bug in the database connector, then it's affecting both PostgreSQL and SQL Server.
Last edit: 8 years 9 months ago by aortiz. Reason: Fixing quotes around JS code
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10613
- Thank you received: 3691
8 years 9 months ago #120694
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Date/Time question crashes survey when only one element selected
Please
file a bug report
, giving all of this test info and post the link to the bug here so we can follow the progress.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- aortiz
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
8 years 9 months ago #120703
by aortiz
Replied by aortiz on topic Date/Time question crashes survey when only one element selected
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
8 years 9 months ago #120815
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Date/Time question crashes survey when only one element selected
Please try LimeSurvey 2.05+ build 150520 with Postgres. Perhaps it works now.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- aortiz
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
8 years 9 months ago #120816
by aortiz
Replied by aortiz on topic Date/Time question crashes survey when only one element selected
My troubleshooting used build 150520 and I tested against Postgres 9.3 and 9.4 Unfortunately, it didn't work. Thanks.
The topic has been locked.