View Issue Details

This bug affects 1 person(s).
 24
IDProjectCategoryView StatusLast Update
09643Bug reportsSurvey takingpublic2017-09-26 14:10
Reporteraortiz Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.06+ 
Summary09643: Date/Time question with drop down values fails validation when only one value is selected and MySQL is not the database
Description

A. This is a recap of the information from the forum link attached under "Additional Information". The issue we're experiencing is that validation is not being triggered on a date/time question under the following circumstances:

  1. The date/time question is configured to "display dropdown boxes"
  2. The "date/time format" is set to "mm/yyyy"
  3. Only one of the date values is selected. For example, select the month but not the year and submit the page
  4. The database used is NOT MySQL. When we tried this test using MySQL, the validation worked perfectly. When the database used was PostgreSQL or SQL Server, we received an error.

B. Our analysis
The problem seems to be related to the JavaScript value "var LEMgseq=;" not being set to anything when the database is not MySQL. The javascript error causes the JS to fail and then leads to the database trying to submit a query that's invalid.

C. Environments Tested

  1. (Works) MySQL 5.5.43, Linux Mint 17.1, Apache, PHP 5.5.9

  2. (FAILS) 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.

  3. (FAILS) MS SQL Server 2008, RHEL 6.3, Apache PHP 5.4.39

  4. (FAILS) MS SQL Server 2008, Windows 7, IIS, PHP 5.3.28

Steps To Reproduce
  1. Import the attached survey
  2. Activate the survey
  3. Execute the survey
  4. Click next and you'll see the only question
  5. Select a month but not the year
  6. Press "Submit"

You should experience an error if the database used is not MySQL

Additional Information

Forum post where this issue was first discussed.

https://www.limesurvey.org/en/forum/design-issues/100365-date-time-question-crashes-survey-when-only-one-element-selected

TagsNo tags attached.
Attached Files
Date_and_maybe_other.png (25,995 bytes)   
Date_and_maybe_other.png (25,995 bytes)   
Trace_config_php.txt (15,259 bytes)   
Debug 1 , DebugSQL = 0

Error executing query in dbExecuteAssoc:CDbCommand failed to execute the SQL statement: SQLSTATE[0A000]: Feature not supported: 7 ERREUR: la valeur date/time � INVALID � n'est plus support�e LINE 1: ...11:52:42', "ipaddr"='172.24.32.129', "786677X1X1"='INVALID' ... ^. The SQL statement executed was: UPDATE lime_survey_786677 SET "lastpage"=0, "datestamp"='2015-11-19 11:52:42', "ipaddr"='172.24.32.129', "786677X1X1"='INVALID' WHERE ID=24


Debug 2 , DebugSQL = 1 

Error executing query in dbExecuteAssoc:CDbCommand failed to execute the SQL statement: SQLSTATE[0A000]: Feature not supported: 7 ERREUR: la valeur date/time � INVALID � n'est plus support�e LINE 1: ...11:55:20', "ipaddr"='172.24.32.129', "786677X1X1"='INVALID' ... ^. The SQL statement executed was: UPDATE lime_survey_786677 SET "lastpage"=0, "datestamp"='2015-11-19 11:55:20', "ipaddr"='172.24.32.129', "786677X1X1"='INVALID' WHERE ID=25
Profiling Summary Report (Time: 0.30730s, Memory: 12,254KB)
Procedure 	Count 	Total (s) 	Avg. (s) 	Min. (s) 	Max. (s)
system.db.CDbCommand.query(SELECT a.attname, LOWER(format_type(a.atttypid, a.atttypmod)) AS type, d.adsrc, a.attnotnull, a.atthasdef, pg_catalog.col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attnum > 0 AND NOT a.attisdropped AND a.attrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = :schema)) ORDER BY a.attnum. Bound with :table='lime_settings_global', :schema='public') 	1 	0.00629 	0.00629 	0.00629 	0.00629
system.db.CDbCommand.query(SELECT conname, consrc, contype, indkey FROM ( SELECT conname, CASE WHEN contype='f' THEN pg_catalog.pg_get_constraintdef(oid) ELSE 'CHECK (' || consrc || ')' END AS consrc, contype, conrelid AS relid, NULL AS indkey FROM pg_catalog.pg_constraint WHERE contype IN ('f', 'c') UNION ALL SELECT pc.relname, NULL, CASE WHEN indisprimary THEN 'p' ELSE 'u' END, pi.indrelid, indkey FROM pg_catalog.pg_class pc, pg_catalog.pg_index pi WHERE pc.oid=pi.indexrelid AND EXISTS ( SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = pc.tableoid AND d.objid = pc.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p') ) ) AS sub WHERE relid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema)). Bound with :table='lime_settings_global', :schema='public') 	1 	0.00484 	0.00484 	0.00484 	0.00484
system.db.CDbCommand.query(SELECT table_name, table_schema FROM information_schema.tables WHERE table_schema=:schema AND table_type='BASE TABLE'. Bound with :schema='public') 	1 	0.00421 	0.00421 	0.00421 	0.00421
system.db.CDbCommand.query(SELECT a.attname, LOWER(format_type(a.atttypid, a.atttypmod)) AS type, d.adsrc, a.attnotnull, a.atthasdef, pg_catalog.col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attnum > 0 AND NOT a.attisdropped AND a.attrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = :schema)) ORDER BY a.attnum. Bound with :table='lime_surveys', :schema='public') 	1 	0.00347 	0.00347 	0.00347 	0.00347
system.db.CDbCommand.query(SELECT conname, consrc, contype, indkey FROM ( SELECT conname, CASE WHEN contype='f' THEN pg_catalog.pg_get_constraintdef(oid) ELSE 'CHECK (' || consrc || ')' END AS consrc, contype, conrelid AS relid, NULL AS indkey FROM pg_catalog.pg_constraint WHERE contype IN ('f', 'c') UNION ALL SELECT pc.relname, NULL, CASE WHEN indisprimary THEN 'p' ELSE 'u' END, pi.indrelid, indkey FROM pg_catalog.pg_class pc, pg_catalog.pg_index pi WHERE pc.oid=pi.indexrelid AND EXISTS ( SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = pc.tableoid AND d.objid = pc.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p') ) ) AS sub WHERE relid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema)). Bound with :table='lime_plugins', :schema='public') 	1 	0.00288 	0.00288 	0.00288 	0.00288
system.db.CDbCommand.query(SELECT conname, consrc, contype, indkey FROM ( SELECT conname, CASE WHEN contype='f' THEN pg_catalog.pg_get_constraintdef(oid) ELSE 'CHECK (' || consrc || ')' END AS consrc, contype, conrelid AS relid, NULL AS indkey FROM pg_catalog.pg_constraint WHERE contype IN ('f', 'c') UNION ALL SELECT pc.relname, NULL, CASE WHEN indisprimary THEN 'p' ELSE 'u' END, pi.indrelid, indkey FROM pg_catalog.pg_class pc, pg_catalog.pg_index pi WHERE pc.oid=pi.indexrelid AND EXISTS ( SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = pc.tableoid AND d.objid = pc.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p') ) ) AS sub WHERE relid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema)). Bound with :table='lime_surveys', :schema='public') 	1 	0.00282 	0.00282 	0.00282 	0.00282
system.db.CDbCommand.query(SELECT "t"."surveyls_survey_id" AS "t0_c0", "t"."surveyls_language" AS "t0_c1", "t"."surveyls_title" AS "t0_c2", "t"."surveyls_description" AS "t0_c3", "t"."surveyls_welcometext" AS "t0_c4", "t"."surveyls_endtext" AS "t0_c5", "t"."surveyls_url" AS "t0_c6", "t"."surveyls_urldescription" AS "t0_c7", "t"."surveyls_email_invite_subj" AS "t0_c8", "t"."surveyls_email_invite" AS "t0_c9", "t"."surveyls_email_remind_subj" AS "t0_c10", "t"."surveyls_email_remind" AS "t0_c11", "t"."surveyls_email_register_subj" AS "t0_c12", "t"."surveyls_email_register" AS "t0_c13", "t"."surveyls_email_confirm_subj" AS "t0_c14", "t"."surveyls_email_confirm" AS "t0_c15", "t"."surveyls_dateformat" AS "t0_c16", "t"."surveyls_attributecaptions" AS "t0_c17", "t"."email_admin_notification_subj" AS "t0_c18", "t"."email_admin_notification" AS "t0_c19", "t"."email_admin_responses_subj" AS "t0_c20", "t"."email_admin_responses" AS "t0_c21", "t"."surveyls_numberformat" AS "t0_c22", "t"."attachments" AS "t0_c23", "survey"."sid" AS "t1_c0", "survey"."owner_id" AS "t1_c1", "survey"."admin" AS "t1_c2", "survey"."active" AS "t1_c3", "survey"."expires" AS "t1_c4", "survey"."startdate" AS "t1_c5", "survey"."adminemail" AS "t1_c6", "survey"."anonymized" AS "t1_c7", "survey"."faxto" AS "t1_c8", "survey"."format" AS "t1_c9", "survey"."savetimings" AS "t1_c10", "survey"."template" AS "t1_c11", "survey"."language" AS "t1_c12", "survey"."additional_languages" AS "t1_c13", "survey"."datestamp" AS "t1_c14", "survey"."usecookie" AS "t1_c15", "survey"."allowregister" AS "t1_c16", "survey"."allowsave" AS "t1_c17", "survey"."autonumber_start" AS "t1_c18", "survey"."autoredirect" AS "t1_c19", "survey"."allowprev" AS "t1_c20", "survey"."printanswers" AS "t1_c21", "survey"."ipaddr" AS "t1_c22", "survey"."refurl" AS "t1_c23", "survey"."datecreated" AS "t1_c24", "survey"."publicstatistics" AS "t1_c25", "survey"."publicgraphs" AS "t1_c26", "survey"."listpublic" AS "t1_c27", "survey"."htmlemail" AS "t1_c28", "survey"."sendconfirmation" AS "t1_c29", "survey"."tokenanswerspersistence" AS "t1_c30", "survey"."assessments" AS "t1_c31", "survey"."usecaptcha" AS "t1_c32", "survey"."usetokens" AS "t1_c33", "survey"."bounce_email" AS "t1_c34", "survey"."attributedescriptions" AS "t1_c35", "survey"."emailresponseto" AS "t1_c36", "survey"."emailnotificationto" AS "t1_c37", "survey"."tokenlength" AS "t1_c38", "survey"."showxquestions" AS "t1_c39", "survey"."showgroupinfo" AS "t1_c40", "survey"."shownoanswer" AS "t1_c41", "survey"."showqnumcode" AS "t1_c42", "survey"."bouncetime" AS "t1_c43", "survey"."bounceprocessing" AS "t1_c44", "survey"."bounceaccounttype" AS "t1_c45", "survey"."bounceaccounthost" AS "t1_c46", "survey"."bounceaccountpass" AS "t1_c47", "survey"."bounceaccountencryption" AS "t1_c48", "survey"."bounceaccountuser" AS "t1_c49", "survey"."showwelcome" AS "t1_c50", "survey"."showprogress" AS "t1_c51", "survey"."questionindex" AS "t1_c52", "survey"."navigationdelay" AS "t1_c53", "survey"."nokeyboard" AS "t1_c54", "survey"."alloweditaftercompletion" AS "t1_c55", "survey"."googleanalyticsstyle" AS "t1_c56", "survey"."googleanalyticsapikey" AS "t1_c57" FROM "lime_surveys_languagesettings" "t" LEFT OUTER JOIN "lime_surveys" "survey" ON (t.surveyls_survey_id = survey.sid) WHERE ("t"."surveyls_survey_id"=786677 AND "t"."surveyls_language"='en')) 	1 	0.00279 	0.00279 	0.00279 	0.00279
system.db.CDbCommand.query(SELECT conname, consrc, contype, indkey FROM ( SELECT conname, CASE WHEN contype='f' THEN pg_catalog.pg_get_constraintdef(oid) ELSE 'CHECK (' || consrc || ')' END AS consrc, contype, conrelid AS relid, NULL AS indkey FROM pg_catalog.pg_constraint WHERE contype IN ('f', 'c') UNION ALL SELECT pc.relname, NULL, CASE WHEN indisprimary THEN 'p' ELSE 'u' END, pi.indrelid, indkey FROM pg_catalog.pg_class pc, pg_catalog.pg_index pi WHERE pc.oid=pi.indexrelid AND EXISTS ( SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = pc.tableoid AND d.objid = pc.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p') ) ) AS sub WHERE relid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema)). Bound with :table='lime_surveys_languagesettings', :schema='public') 	1 	0.00276 	0.00276 	0.00276 	0.00276
system.db.CDbCommand.query(SELECT conname, consrc, contype, indkey FROM ( SELECT conname, CASE WHEN contype='f' THEN pg_catalog.pg_get_constraintdef(oid) ELSE 'CHECK (' || consrc || ')' END AS consrc, contype, conrelid AS relid, NULL AS indkey FROM pg_catalog.pg_constraint WHERE contype IN ('f', 'c') UNION ALL SELECT pc.relname, NULL, CASE WHEN indisprimary THEN 'p' ELSE 'u' END, pi.indrelid, indkey FROM pg_catalog.pg_class pc, pg_catalog.pg_index pi WHERE pc.oid=pi.indexrelid AND EXISTS ( SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = pc.tableoid AND d.objid = pc.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p') ) ) AS sub WHERE relid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema)). Bound with :table='lime_permissions', :schema='public') 	1 	0.00275 	0.00275 	0.00275 	0.00275
system.db.CDbCommand.query(SELECT a.attname, LOWER(format_type(a.atttypid, a.atttypmod)) AS type, d.adsrc, a.attnotnull, a.atthasdef, pg_catalog.col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attnum > 0 AND NOT a.attisdropped AND a.attrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = :schema)) ORDER BY a.attnum. Bound with :table='lime_surveys_languagesettings', :schema='public') 	1 	0.00238 	0.00238 	0.00238 	0.00238
system.db.CDbCommand.query(SELECT a.attname, LOWER(format_type(a.atttypid, a.atttypmod)) AS type, d.adsrc, a.attnotnull, a.atthasdef, pg_catalog.col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attnum > 0 AND NOT a.attisdropped AND a.attrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = :schema)) ORDER BY a.attnum. Bound with :table='lime_permissions', :schema='public') 	1 	0.00198 	0.00198 	0.00198 	0.00198
system.db.CDbCommand.query(SELECT a.attname, LOWER(format_type(a.atttypid, a.atttypmod)) AS type, d.adsrc, a.attnotnull, a.atthasdef, pg_catalog.col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attnum > 0 AND NOT a.attisdropped AND a.attrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = :schema)) ORDER BY a.attnum. Bound with :table='lime_plugins', :schema='public') 	1 	0.00174 	0.00174 	0.00174 	0.00174
system.db.CDbCommand.query(SELECT * FROM "lime_surveys" "t" WHERE "t"."sid"=786677 LIMIT 1) 	1 	0.00156 	0.00156 	0.00156 	0.00156
system.db.CDbCommand.query(SELECT * FROM "lime_permissions" "t" WHERE "t"."entity_id"=:yp0 AND "t"."entity"=:yp1 AND "t"."uid"=:yp2 AND "t"."permission"=:yp3 LIMIT 1. Bound with :yp0=0, :yp1='global', :yp2=1, :yp3='superadmin') 	1 	0.00147 	0.00147 	0.00147 	0.00147
system.db.CDbCommand.query(SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE attrelid=( SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace=( SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema ) ) AND attnum IN (1, 2). Bound with :table='lime_surveys_languagesettings', :schema='public') 	1 	0.00095 	0.00095 	0.00095 	0.00095
system.db.CDbCommand.query(UPDATE lime_survey_786677 SET "lastpage"=0, "datestamp"='2015-11-19 11:55:20', "ipaddr"='172.24.32.129', "786677X1X1"='INVALID' WHERE ID=25) 	1 	0.00093 	0.00093 	0.00093 	0.00093
system.db.CDbCommand.query(SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE attrelid=( SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace=( SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema ) ) AND attnum IN (1). Bound with :table='lime_settings_global', :schema='public') 	1 	0.00081 	0.00081 	0.00081 	0.00081
system.db.CDbCommand.query(SELECT * FROM "lime_settings_global" "t") 	1 	0.00081 	0.00081 	0.00081 	0.00081
system.db.CDbCommand.query(SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE attrelid=( SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace=( SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema ) ) AND attnum IN (1). Bound with :table='lime_plugins', :schema='public') 	1 	0.00075 	0.00075 	0.00075 	0.00075
system.db.CDbCommand.query(SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE attrelid=( SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace=( SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema ) ) AND attnum IN (1). Bound with :table='lime_permissions', :schema='public') 	1 	0.00074 	0.00074 	0.00074 	0.00074
system.db.CDbCommand.query(SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE attrelid=( SELECT oid FROM pg_catalog.pg_class WHERE relname=:table AND relnamespace=( SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema ) ) AND attnum IN (1). Bound with :table='lime_surveys', :schema='public') 	1 	0.00073 	0.00073 	0.00073 	0.00073
system.db.CDbCommand.query(SELECT * FROM "lime_plugins" "t" WHERE "t"."active"=:yp0. Bound with :yp0=1) 	1 	0.00068 	0.00068 	0.00068 	0.00068
Trace_config_php.txt (15,259 bytes)   
Bug heat24
Complete LimeSurvey version number (& build)Version 2.05+ Build 150520
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 5.5.43 (works), PostgreSQL 9.4 and SQL Server 2008 (don't work)
Server OS (if known)Linux Mint 17.1, RHEL 6.3, Windows 7
Webserver software & version (if known)Apache, IIS
PHP Version5.3.28, 5.4.39, PHP 5.5.9

Relationships

related to 08224 closedmfaber incompletely filled out dates (dropdown mode) are recorded as missing 
related to 10011 closedDenisChenu Date/Time "Dropdown Boxes" functionality does not respect min/max date values set to a calculated date (such as "now") 
related to 12711 closedDenisChenu Date with dropdow throw SQL error with pgsql 

Users monitoring this issue

Activities

aortiz

aortiz

2015-05-20 16:30

reporter   ~32251

Additional information that I didn't stress enough: The validation WORKS on ALL of the databases when the survey is not active.

The error only occurs when the survey is active.

DenisChenu

DenisChenu

2015-07-24 09:35

developer   ~32772

MySQL accept invalid date, not other SQL ....
Then we must save a valid date ....

Use 1970-01-01 for valid date ?
Then with only year :
2015 => 2015-01-01
only month:
december : 1970-12-01

?

c_schmitz

c_schmitz

2015-08-04 12:16

administrator   ~32877

Last edited: 2015-08-04 12:16

mfaber, this is a followup error of your fix in 08224 - basically the problem is that you fill the date value with the word 'INVALID' which MySQL converts to 0000-00-00 00:00 without a complain, but Postgres and MSSQL crash out.
The solution is obviously not to save the value at all ( or a NULL) instead of trying to save the text 'INVALID' - are you up to fix this?

mfaber

mfaber

2015-08-13 15:04

reporter   ~32941

Last edited: 2015-12-11 19:43

Just now i wanted to cherry-pick the changes to the develop branch. The respective section in em_manager_helper.php (line 4226 and following) is, however, commented out. Sam, git blame points to "2af9e609 (Sam 2015-07-24 17:01:19 +0200 4226)". Can you tell where or why this section has gone? Thanks, M

sammousa

sammousa

2015-08-13 15:32

reporter   ~32944

I think this should go here:
https://github.com/LimeSurvey/LimeSurvey/blob/develop/application/models/Response.php#L158

Note that this is only meant to do basic data validation to make sure data is saved succesfully.

Actual validation options like minimum or maximum will be implemented in the question objects.

mfaber

mfaber

2015-08-13 17:53

reporter   ~32945

Thanks for the clarification, sammousa. I am not familiar with the new data structure and question objects. I have thus for now only updated the commented code on the dev branch to also contain the fix.

DenisChenu

DenisChenu

2015-11-20 11:11

developer   ~33612

Postgrey user ask reopen : not fixed
https://www.limesurvey.org/en/forum/french-forum/102978-bugs-divers-avec-postgresql-9-xx#128630

riqcles

riqcles

2015-11-20 11:24

reporter   ~33613

I add screen capture and file text

riqcles

riqcles

2015-11-20 11:25

reporter   ~33614

Build 151018

Config :
OS : Centos 7
BDD : Postgresql 9.4
PHP: 5.4
Firefox 31

Fresh install

c_schmitz

c_schmitz

2015-12-04 15:18

administrator   ~33701

mfaber, up for it?

intavg

intavg

2015-12-11 19:02

reporter   ~33896

Related to this (I think) - no validation at all is being done on the date. I can't flag a date as mandatory, and it submits regardless of what I enter.

For anyone else that runs into this, this is a workaround that I came up with:

<script type="text/javascript">
$("form").on("submit", function( event ) {
var msg = '';
var not_valid = false;
if($("#month488965X31X428").val() == "") {
msg = msg+"Month is required\n";
not_valid = true;
}

    if ($(&quot;#year488965X31X428&quot;).val() == &quot;&quot;) {
        msg = msg+&quot;Year is required&quot;;
        not_valid = true;
    }

    if (not_valid) {
        alert(msg);
        $('#movenextbtn').prop('disabled', false);
        $('#movenextbtn').removeClass('active');
        return false;
    }
});

</script>

DenisChenu

DenisChenu

2015-12-11 19:41

developer   ~33898

We have

$sDateLangvarJS=&quot; translt = {
     alertInvalidDate: '&quot; . gT('Date entered is invalid!','js') . &quot;',
     infoCompleteAll: '&quot; . gT('Please complete all parts of the date!','js') . &quot;'
    };&quot;;

Think it's bets if we deactivate submit in JS. But date is the only one to have such system (show an error before submit). Maybe for > 2.5

I make some test with pgsql after 10011

DenisChenu

DenisChenu

2015-12-17 11:20

developer   ~34036

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

blocka

blocka

2017-09-19 22:01

reporter   ~44431

Interestingly, I have run across a similar scenario as this - running LS 2.67.3, build 170728. LS running on AWS, against Amazon's Aurora DB (which is said to be mySQL compatible).

Survey has a date question with dropdown. We don't have any filtering on the date -- just (see also attached screen shot):
Display dropdown boxes: On
Hide tip: On
Month display style: Short names
Date/time format: None specified
Minute step interval: 1

Survey is active, and error doesn't happen for every respondent (5000+ responses, and we've had about 10-15 people report the error:
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.

1.png (50,546 bytes)   
1.png (50,546 bytes)   

Related Changesets

LimeSurvey: master 42f19d1a

2015-08-13 12:40:03

mfaber


Committer: mfaber Details Diff
Fixed issue 09643: Date/Time validation error if DB!=MySQL

Dev: I only have MySQL, so could not test. Hope this is fixed now.
Dev: Thanks to aortiz and cschmitz for thorough investigation
Affected Issues
09643
mod - application/helpers/expressions/em_manager_helper.php Diff File

LimeSurvey: master 9f6703c0

2015-12-17 10:20:21

DenisChenu

Details Diff
Fixed issue 09643: Date/Time question with drop down can break DB save with pgsql
Fixed issue : Add an empty default tip for all date question
Dev: Fix "INVALID" only when saving in DB, keep the session
Dev: Use EM to validate in PHP: LEMval JS return empty string for "INVALID" : do it manually after EM
Affected Issues
09643
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - application/helpers/qanda_helper.php Diff File
mod - scripts/date.js Diff File

Issue History

Date Modified Username Field Change
2015-05-20 16:27 aortiz New Issue
2015-05-20 16:27 aortiz File Added: limesurvey_survey_786677.lss
2015-05-20 16:27 aortiz Issue Monitored: aortiz
2015-05-20 16:30 aortiz Note Added: 32251
2015-05-20 18:08 mfaber Issue Monitored: mfaber
2015-05-20 19:17 DenisChenu Issue Monitored: DenisChenu
2015-05-30 00:23 aesteban Issue Monitored: aesteban
2015-06-01 08:58 Mazi Assigned To => c_schmitz
2015-06-01 08:58 Mazi Status new => assigned
2015-07-24 09:35 DenisChenu Note Added: 32772
2015-08-04 12:12 c_schmitz Relationship added related to 08224
2015-08-04 12:13 c_schmitz Assigned To c_schmitz => mfaber
2015-08-04 12:16 c_schmitz Note Added: 32877
2015-08-04 12:16 c_schmitz Note Edited: 32877
2015-08-13 14:46 c_schmitz Changeset attached => LimeSurvey master 42f19d1a
2015-08-13 15:04 mfaber Issue Monitored: sammousa
2015-08-13 15:04 mfaber Note Added: 32941
2015-08-13 15:06 mfaber Assigned To mfaber => sammousa
2015-08-13 15:06 mfaber Status assigned => feedback
2015-08-13 15:06 mfaber Resolution open => fixed
2015-08-13 15:32 sammousa Note Added: 32944
2015-08-13 17:53 mfaber Note Added: 32945
2015-08-13 17:55 mfaber Fixed in Version => 2.06+
2015-08-14 09:47 c_schmitz Status feedback => closed
2015-08-14 09:47 c_schmitz Assigned To sammousa =>
2015-11-20 11:11 DenisChenu Assigned To => DenisChenu
2015-11-20 11:11 DenisChenu Note Added: 33612
2015-11-20 11:11 DenisChenu Status closed => feedback
2015-11-20 11:11 DenisChenu Resolution fixed => reopened
2015-11-20 11:23 riqcles File Added: Date_and_maybe_other.png
2015-11-20 11:23 riqcles File Added: Trace_config_php.txt
2015-11-20 11:24 riqcles Note Added: 33613
2015-11-20 11:25 riqcles Note Added: 33614
2015-12-03 11:15 DenisChenu Status feedback => assigned
2015-12-04 09:20 c_schmitz Assigned To DenisChenu => mfaber
2015-12-04 15:18 c_schmitz Note Added: 33701
2015-12-11 19:02 intavg Note Added: 33896
2015-12-11 19:34 DenisChenu Relationship added related to 10011
2015-12-11 19:41 DenisChenu Note Added: 33898
2015-12-11 19:43 mfaber Note Edited: 32941
2015-12-15 20:18 DenisChenu Assigned To mfaber => DenisChenu
2015-12-16 11:16 DenisChenu Status assigned => confirmed
2015-12-17 11:20 DenisChenu Changeset attached => LimeSurvey master 9f6703c0
2015-12-17 11:20 DenisChenu Note Added: 34036
2015-12-17 11:21 DenisChenu Status confirmed => resolved
2015-12-17 11:21 DenisChenu Resolution reopened => fixed
2016-01-22 08:54 c_schmitz Status resolved => closed
2017-09-19 22:01 blocka File Added: 1.png
2017-09-19 22:01 blocka Note Added: 44431
2017-09-26 14:10 DenisChenu Relationship added related to 12711
2021-08-02 17:39 guest Bug heat 16 => 24