Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
16937Bug reportsSurvey takingpublic2021-01-24 22:36
Reportergabrieljenik Assigned To 
PrioritynoneSeveritycrash 
Status newResolutionopen 
Product Version4.4.0-RC1 
Summary16937: Easy way to launch CDBException
Description

Really easy to launch a CDbException publicly

Steps To Reproduce

Import included survey
Copy the start link with newtest=Y
Add &Q00=ABCDEFGHIJ
Send the link

Additional Information

Seems prefilled value are not filtered with https://github.com/LimeSurvey/LimeSurvey/blob/bdd01aab12a6c9897cb777fbb8e3692a6f95858d/application/helpers/expressions/em_manager_helper.php#L10132

Here it's with mysql, but other have same issue (date for example)

The 2 htmlk are done with debug or without

Original solution for LS3 on 16481 needs to be ported or enhanced for LS4.

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.4.0-RC1
I will donate to the project if issue is resolvedNo
Sync to Zoho ProjectYes
Browsernot relevant
Database & DB-Versionmariadb
Server OS (if known)fedora/linux
Webserver software & version (if known)nginx
PHP Versionphp7.3

Relationships

related to 16481 closedDenisChenu Easy way to launch CDBException 

Activities

gabrieljenik

gabrieljenik

2021-01-05 14:25

developer   ~61432

PR: https://github.com/LimeSurvey/LimeSurvey/pull/1708

gabrieljenik

gabrieljenik

2021-01-11 17:11

developer   ~61481

Last edited: 2021-01-13 16:48

@DenisChenu commented on the PR:

for master : we need a better solution : move after setMoveResult ?

We have moved it:

  • from StartSurvey(), which is run inside initFirstStep()
  • to after setMoveResult

This is the list of steps it does for starting up:

    /**
     * Init session/params values depending of user moves
     *
     * - It init the needed variables for navigation: initFirstStep, initTotalAndMaxSteps, setMoveResult
     * - Then perform all the needed checks before moving:
     *   + did the participant used browser navigation?
     *   + did he pressed clear cancel, is he a confirmed quota?
     *   + Is the previous step set?
     *   + Is the survey finished?
     *   + Are all the answer validated? (like: participant didn't answered to a mandatory question)
     */
    private function initMove()
    {
        $this->initFirstStep(); // If it's the first time user load this survey, will init session and LEM
        $this->initTotalAndMaxSteps();
        $this->checkIfUseBrowserNav(); // Check if user used browser navigation, or relaoded page
        if ($this->sMove != 'clearcancel' && $this->sMove != 'confirmquota') {
            $this->checkPrevStep(); // Check if prev step is set, else set it
            $this->setMoveResult();
            $this->checkClearCancel();
            $this->setPrevStep();
            $this->checkIfFinished();
            $this->setStep();
            $this->saveStartingValues();

Why do we need to move it after setMoveResult()?
Shouldn't it be done before so the EM data is available for setting the move?

DenisChenu

DenisChenu

2021-01-11 17:18

developer   ~61482

Last edited: 2021-01-13 16:48

To fix https://bugs.limesurvey.org/view.php?id=16482

prefilling value muts be done only when create survey by another way :)

DenisChenu

DenisChenu

2021-01-11 17:19

developer   ~61483

Last edited: 2021-01-13 16:48

PS :
Another solution : set it to defaultValue on EM ?

gabrieljenik

gabrieljenik

2021-01-12 21:55

developer   ~61507

Last edited: 2021-01-13 16:48

View 2 revisions

I understand now.
So now this ticket and 16482 (but for lsv4) are fixed.

This approach is OK for me!

DenisChenu

DenisChenu

2021-01-13 08:04

developer   ~61513

Last edited: 2021-01-13 16:48

Finally : i think you're right …

Use default value system are (maybe) not the best solution …

  • Prefill : value was set at start of survey even if variables are in last group
  • Default : value was set when step happen (for exemple : in last group : set just before submit).

I'm totally unsure on the best solution here … Using defaultvalue seems cool but unsure it the best solution.
https://github.com/LimeSurvey/LimeSurvey/blob/68ce18e22194171e1c56c27f36ad7ce5b34adc8a/application/helpers/expressions/em_manager_helper.php#L7126

gabrieljenik

gabrieljenik

2021-01-14 17:36

developer   ~61545

Ok, as to start fresh and avoid missunderstandings, I feel comfortable with the latest PR.
What do you think?

DenisChenu

DenisChenu

2021-01-14 17:42

developer   ~61546

if ($this->sSurveyMode != 'survey' && $_SESSION[$this->LEMsessid]['step'] == 0) return;

Yep : seems OK !

Maybe check $this->aSurveyInfo['showwelcome'] ? https://github.com/LimeSurvey/LimeSurvey/blob/79656ae39499fafd8a36c6ee12c5c9649d74df70/application/helpers/SurveyRuntimeHelper.php#L788

gabrieljenik

gabrieljenik

2021-01-24 22:36

developer   ~61657

New PR: https://github.com/LimeSurvey/LimeSurvey/pull/1726

Issue History

Date Modified Username Field Change
2020-12-31 15:24 gabrieljenik New Issue
2020-12-31 15:24 gabrieljenik Issue generated from: 16481
2020-12-31 15:25 gabrieljenik Additional Information Updated View Revisions
2020-12-31 15:25 gabrieljenik Relationship added related to 16481
2021-01-05 14:25 gabrieljenik Note Added: 61432
2021-01-11 17:11 gabrieljenik Note Added: 61481
2021-01-11 17:18 DenisChenu Note Added: 61482
2021-01-11 17:19 DenisChenu Note Added: 61483
2021-01-12 21:55 gabrieljenik Note Added: 61507
2021-01-12 21:56 gabrieljenik Note Edited: 61507 View Revisions
2021-01-13 08:04 DenisChenu Note Added: 61513
2021-01-13 16:48 cdorin Sync to Zoho Project => Yes
2021-01-14 17:36 gabrieljenik Note Added: 61545
2021-01-14 17:42 DenisChenu Note Added: 61546
2021-01-24 22:36 gabrieljenik Note Added: 61657