Date/Time question crashes survey when only one element selected

More
2 years 6 months ago #120537 by RaCMJS
RaCMJS created the topic: Date/Time question crashes survey when only one element selected
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!

Please Log in to join the conversation.

More
2 years 6 months ago #120556 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
2 years 6 months ago #120606 by RaCMJS
RaCMJS replied the 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.
Attachments:

Please Log in to join the conversation.

More
2 years 6 months ago #120629 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
2 years 6 months ago #120664 by RaCMJS
RaCMJS replied the 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.

Please Log in to join the conversation.

More
2 years 6 months ago #120666 by RaCMJS
RaCMJS replied the 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....

Please Log in to join the conversation.

More
2 years 6 months ago - 2 years 6 months ago #120670 by jelo
jelo replied the 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
Last Edit: 2 years 6 months ago by jelo.

Please Log in to join the conversation.

More
2 years 6 months ago - 2 years 6 months ago #120688 by aortiz
aortiz replied the 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.
Last Edit: 2 years 6 months ago by aortiz. Reason: Fixing quotes around JS code

Please Log in to join the conversation.

More
2 years 6 months ago #120694 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
2 years 6 months ago #120703 by aortiz
aortiz replied the topic: Date/Time question crashes survey when only one element selected

Please Log in to join the conversation.

More
2 years 6 months ago #120815 by jelo
jelo replied the topic: Date/Time question crashes survey when only one element selected
Please try LimeSurvey 2.05+ build 150520 with Postgres. Perhaps it works now.

Please Log in to join the conversation.

More
2 years 6 months ago #120816 by aortiz
aortiz replied the 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.

Please Log in to join the conversation.

More
2 months 3 weeks ago #158823 by blocka
blocka replied the topic: Date/Time question crashes survey when only one element selected
I just encountered this same error on a survey. I updated the issue:
bugs.limesurvey.org/view.php?id=9643
But I realized that it stays closed even though I put a note on it, so not sure if it will catch anyone's attention...

Please Log in to join the conversation.

More
2 months 3 weeks ago #158832 by DenisChenu
DenisChenu replied the topic: Date/Time question crashes survey when only one element selected
This particullary bug has been fixed (and tested by me ;) )

Mayube we update another part somewhere else : then it's a new bug :/ Surely linked with this one (related to )

Denis
PS : date question type are really awfull …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!