View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
10840Bug reportsSurvey takingpublic2016-04-18 22:48
ReporterDenisChenu Assigned Toollehar  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version2.50.x 
Fixed in Version2.50.x 
Summary10840: DB issue in susrvey : system is broken
Description

When there are a DB issue in survey : all system is broken.
-> debug set to 2 : show SQL error
-> debug set to 0 : session is resetted BUT page is shown ....

Steps To Reproduce

Get the file in https://bugs.limesurvey.org/view.php?id=10827
Use PG to have DB issue

Set debug to 0

  • ENter in survey
  • Next / Next / Next : qhow an error (hidden by header) No content in survey (empty qanda)
  • Next : We are sorry but your session has expired.

Set debug to ,2:

  • Next/next/next
  • Show SQL error

In the mail : show no infoirmation on the error.

Additional Information

https://bugs.limesurvey.org/view.php?id=10827 must be fixed but even after there can have DB issue.
If we reset the session : Throw error 500 ? With more infoprmation with debug 2 than with debug 0.

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)160330
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionPostgreSQL 9.1.20 (but other DB can have issue too)
Server OS (if known)debian7/linux
Webserver software & version (if known)apache
PHP VersionPHP Version 5.4

Relationships

related to 10827 closedDenisChenu Whole answers must be filtered before try to save in DB 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2016-03-30 14:10

developer   ~36836

Thank you olle:)

ollehar

ollehar

2016-03-30 14:23

administrator   ~36837

How is this a bug? When you're putting "MoreThan5" as value, you're breaking the interface of the question?

DenisChenu

DenisChenu

2016-03-30 14:27

developer   ~36838

You need pg because with mysql : no issue.

With "MoreThan5" : you broke "Response save" here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L5424

Then submitfailed function from front_end helper is called.

This function :

  • return a message for the user : then it "echo" to the user , BEFORE the html
  • kill the session
  • don't kill the page or die or anything

But you need an adminemail ....

The "MoreThan5" broke pgsql : it's another issue.

ollehar

ollehar

2016-03-30 14:48

administrator   ~36839

Is the solution a proper error message? Because I don't want pgsql to fail silently, as mysql.

DenisChenu

DenisChenu

2016-03-30 15:01

developer   ~36841

I work actually in 10827 . I want to show message for some "Error" too . But don't break Survey (don't reset session).

I want to do 2 thing:

  • Construct the "DB/core validation" error message in EM somewhere
  • Set to NULL in DB if value have an error.

Actually i search a way to add message in _validateUestion ... to add it in EM system dynamicly . But :

  • Not the good way
  • Not easy
  • Must be rewritten for 3.0

If you're OK : i just condtruct an error message

Example here; https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L5401

Adding regexp for DECIMAL(30,10), don't reset the $_SESSION var
Add an "error" tag/boolean

The we mist shown the "Question page" with error somewhere. Just like it was "mandatory" or somethiug like here.

I send some of code tomorrow :

  • regexp for DECIMAL
  • answer in possible answer for radio/dropdown

OK ?

DenisChenu

DenisChenu

2016-03-30 15:06

developer   ~36842

Oups ... another poiunt:
Even with a good filtering system DB save can broke ....
Then : have a cleanest way for this part is a must done.

DenisChenu

DenisChenu

2016-03-30 15:21

developer   ~36844

@olle : see comment here : https://github.com/LimeSurvey/LimeSurvey/commit/f438b28914917dec7944291a7bad67719ceec419#diff-796aba4d06254b9caea9d461e4ea80c9R5404

For information : i try to update $this->qid2validationEqn[$qid]['eqn'] and msg here : but _validateUestion is already done ....

Then i add it before // DETECT ANY VIOLATIONS OF VALIDATION RULES // manually but really .... it's not the best way .... EM is awfull ..

ollehar

ollehar

2016-03-30 16:39

administrator   ~36845

Yeah, we need a system to show messages that's not "echo".

ollehar

ollehar

2016-03-30 16:39

administrator   ~36846

I'd say Yii flash message.

DenisChenu

DenisChenu

2016-03-30 17:32

developer   ~36847

flash message : only JS ?

Else we have a place for error here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/SurveyRuntimeHelper.php#L1207

You adde an infor on stepInfo ?

ollehar

ollehar

2016-03-30 18:00

administrator   ~36849

http://www.yiiframework.com/wiki/21/how-to-work-with-flash-messages/

Think it generates HTML, and then do some Bootstrap enhancement. Not sure.

I want to avoid adding things in run(). Also echo is hard to get good control-flow with.

What's stepinfo?

DenisChenu

DenisChenu

2016-03-30 19:36

developer   ~36850

Yes, i know flashMessage :). Sorry bad reading didn't see the Yii before.

Very good idea : and popups can be moved to view system for flashMessage.

Actually : we don't have flashMessage for public.

I like to extedn flashMessage to have different "style".
https://github.com/LimeSurvey/LimeSurvey/commit/ee7e746113f136939ad02e49981aa8ccfee8a005 ;)

c_schmitz

c_schmitz

2016-04-18 22:48

administrator   ~37512

Version 2.06LTS Build 160417 released
Version 2.50+ Build 160418 released

Issue History

Date Modified Username Field Change
2016-03-30 09:37 DenisChenu New Issue
2016-03-30 13:44 ollehar Assigned To => ollehar
2016-03-30 13:44 ollehar Status new => assigned
2016-03-30 14:10 DenisChenu Note Added: 36836
2016-03-30 14:23 ollehar Note Added: 36837
2016-03-30 14:27 DenisChenu Note Added: 36838
2016-03-30 14:28 DenisChenu Relationship added related to 10827
2016-03-30 14:48 ollehar Note Added: 36839
2016-03-30 15:01 DenisChenu Note Added: 36841
2016-03-30 15:06 DenisChenu Note Added: 36842
2016-03-30 15:21 DenisChenu Note Added: 36844
2016-03-30 16:39 ollehar Note Added: 36845
2016-03-30 16:39 ollehar Note Added: 36846
2016-03-30 17:32 DenisChenu Note Added: 36847
2016-03-30 18:00 ollehar Note Added: 36849
2016-03-30 19:36 DenisChenu Note Added: 36850
2016-04-18 12:37 ollehar Status assigned => resolved
2016-04-18 12:37 ollehar Fixed in Version => 2.5
2016-04-18 12:37 ollehar Resolution open => fixed
2016-04-18 22:48 c_schmitz Note Added: 37512
2016-04-18 22:48 c_schmitz Status resolved => closed