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?
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?
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.
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?
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....
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.
Last edit: 9 years 11 months ago by aortiz. Reason: Fixing quotes around JS code