Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
14254Bug reportsSurvey editingpublic2020-03-06 00:54
Reporterriqcles Assigned Tomarkusfluer 
PriorityhighSeveritypartial_block 
Status closedResolutionunable to reproduce 
Product Version3.13.x 
Summary14254: Quotas with AJAX == Php Notice
Description

Hello, when creating quotas, after activating the questionnaire we get a php (debug a 2) error that appears if AJAX is disabled.

I put the quiz for the tests.

I add the log trace I had.

Steps To Reproduce

import the questionnaire
activate
answer the question by no

Additional Information

Informations système
Votre configuration système :

Version de LimeSurvey
181108
Système d’exploitation
Linux galileo.intranet 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64
Version de PHP
5.6.27
Nom du serveur web
192.168.56.113
Logiciel du serveur web
Apache/2.4.6 (CentOS) PHP/5.6.27
Information sur le serveur web
Pilote de la base de données
pgsql
Version du connecteur de base de données
9.2.15
Information sur le serveur de base de données
PID: 4208; Client Encoding: UTF8; Is Superuser: on; Session Authorization: postgres; Date Style: ISO, DMY
Version du serveur de base de données
PID: 4208; Client Encoding: UTF8; Is Superuser: on; Session Authorization: postgres; Date Style: ISO, DMY
TagsNo tags attached.
Attached Files
Screenshot_4.png (55,616 bytes)   
Screenshot_4.png (55,616 bytes)   
Bug heat10
Complete LimeSurvey version number (& build)Version 3.15.3+181108
I will donate to the project if issue is resolvedNo
BrowserFirefox
Database type & versionPostgresql 9.4
Server OS (if known)Centos 7
Webserver software & version (if known)apache 2.4
PHP Versionphp 5.6

Relationships

related to 14616 closedLouisGac Disable AJAXMode by default or deactivate AJAXMode completly 

Activities

riqcles

riqcles

2018-11-14 14:57

reporter   ~49656

Theme vanilla -> ajax mis à "Non" (option de thème).

PHP notice

Undefined variable: clienttoken

/applis/limesurvey3/application/controllers/survey/index.php(242)

230 }
231
232 // recompute $redata since $saved_id used to be a global
233 $redata = compact(array_keys(get_defined_vars()));
234
235 if ($this->_didSessionTimeout($surveyid)) {
236 $aErrors = array(gT('We are sorry but your session has expired.'));
237 $aMessage = array(
238 gT("Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection."),
239 );
240
241 $aReloadUrlParam = array('lang'=>App()->language, 'newtest'=>'Y');
242 if ($clienttoken) {
243 $aReloadUrlParam = $clienttoken;
244 }
245 $aUrl = array(
246 'url'=>$this->getController()->createUrl("/survey/index/sid/{$surveyid}", $aReloadUrlParam),
247 'type'=>'restart-survey',
248 'description'=>gT("Click here to start the survey.")
249 );
250
251 $event = new PluginEvent('onSurveyDenied');
252 $event->set('surveyId', $surveyid);
253 $event->set('reason', 'sessionExpired');
254 App()->getPluginManager()->dispatchEvent($event);

Stack Trace
#0

/applis/limesurvey3/application/controllers/survey/index.php(24): index->action()

19 public $oTemplate;
20
21 public function run()
22 {
23 useFirebug();
24 $this->action();
25 }
26
27 public function action()
28 {
29 global $surveyid;

#1

/applis/limesurvey3/framework/web/actions/CAction.php(76): index->run()

71 {
72 $method=new ReflectionMethod($this, 'run');
73 if($method->getNumberOfParameters()>0)
74 return $this->runWithParamsInternal($this, $method, $params);
75
76 $this->run();
77 return true;
78 }
79
80 /*
81
Executes a method of an object with the supplied named parameters.

#2

/applis/limesurvey3/framework/web/CController.php(308): CAction->runWithParams(array("sid" => "627969"))

303 {
304 $priorAction=$this->_action;
305 $this->_action=$action;
306 if($this->beforeAction($action))
307 {
308 if($action->runWithParams($this->getActionParams())===false)
309 $this->invalidActionParams($action);
310 else
311 $this->afterAction($action);
312 }
313 $this->_action=$priorAction;

#3

/applis/limesurvey3/framework/web/CController.php(286): CController->runAction(index)

281 @see runAction
282
/
283 public function runActionWithFilters($action,$filters)
284 {
285 if(empty($filters))
286 $this->runAction($action);
287 else
288 {
289 $priorAction=$this->_action;
290 $this->_action=$action;
291 CFilterChain::create($this,$action,$filters)->run();

#4

/applis/limesurvey3/framework/web/CController.php(265): CController->runActionWithFilters(index, array())

260 {
261 if(($parent=$this->getModule())===null)
262 $parent=Yii::app();
263 if($parent->beforeControllerAction($this,$action))
264 {
265 $this->runActionWithFilters($action,$this->filters());
266 $parent->afterControllerAction($this,$action);
267 }
268 }
269 else
270 $this->missingAction($actionID);

#5

/applis/limesurvey3/framework/web/CWebApplication.php(282): CController->run("index")

277 {
278 list($controller,$actionID)=$ca;
279 $oldController=$this->_controller;
280 $this->_controller=$controller;
281 $controller->init();
282 $controller->run($actionID);
283 $this->_controller=$oldController;
284 }
285 else
286 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
287 array('{route}'=>$route===''?$this->defaultController:$route)));

#6

/applis/limesurvey3/framework/web/CWebApplication.php(141): CWebApplication->runController("survey/index/sid/627969")

136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value)
137 $_GET[$name]=$value;
138 }
139 else
140 $route=$this->getUrlManager()->parseUrl($this->getRequest());
141 $this->runController($route);
142 }
143
144 /*
145
Registers the core application components.
146 * This method overrides the parent implementation by registering additional core components.

#7

/applis/limesurvey3/framework/base/CApplication.php(185): CWebApplication->processRequest()

180 public function run()
181 {
182 if($this->hasEventHandler('onBeginRequest'))
183 $this->onBeginRequest(new CEvent($this));
184 register_shutdown_function(array($this,'end'),0,false);
185 $this->processRequest();
186 if($this->hasEventHandler('onEndRequest'))
187 $this->onEndRequest(new CEvent($this));
188 }
189
190 /**

#8

/applis/limesurvey3/index.php(194): CApplication->run()

189 require_once APPPATH . 'core/LSYii_Application' . EXT;
190
191 $config = require_once(APPPATH . 'config/internal' . EXT);
192
193 Yii::$enableIncludePath = false;
194 Yii::createApplication('LSYii_Application', $config)->run();
195
196 / End of file index.php /
197 / Location: ./index.php /

riqcles

riqcles

2018-11-14 14:58

reporter   ~49657

Ajax activé :

PHP Error [500]

Undefined variable: clienttoken (/applis/limesurvey3/application/controllers/survey/index.php:242)

#0 /applis/limesurvey3/framework/base/CApplication.php(834): CErrorHandler->handle()
#1 /applis/limesurvey3/application/controllers/survey/index.php(242): LSYii_Application->handleError()
#2 /applis/limesurvey3/application/controllers/survey/index.php(24): index->action()
#3 /applis/limesurvey3/framework/web/actions/CAction.php(76): index->run()
#4 /applis/limesurvey3/framework/web/CController.php(308): index->runWithParams()
#5 /applis/limesurvey3/framework/web/CController.php(286): SurveyController->runAction()
#6 /applis/limesurvey3/framework/web/CController.php(265): SurveyController->runActionWithFilters()
#7 /applis/limesurvey3/framework/web/CWebApplication.php(282): SurveyController->run()
#8 /applis/limesurvey3/framework/web/CWebApplication.php(141): LSYii_Application->runController()
#9 /applis/limesurvey3/framework/base/CApplication.php(185): LSYii_Application->processRequest()
#10 /applis/limesurvey3/index.php(194): LSYii_Application->run()

DenisChenu

DenisChenu

2018-11-14 14:58

developer   ~49658

I think you must :

  1. import the questionnaire
  2. activate
  3. answer the question by no
  4. Restart questionnaire with quick link (not menu link)
  5. answer by no again
riqcles

riqcles

2018-11-14 15:02

reporter   ~49659

I try by the menu :

http://192.168.56.113/limesurvey3/index.php/627969?newtest=Y&lang=fr

and by the quick link

http://192.168.56.113/limesurvey3/index.php/627969?lang=fr

same error

DenisChenu

DenisChenu

2018-11-14 15:04

developer   ~49660

I can't fix : you have a session timeout somewhere …

I fix the issue with «Undefined variable: clienttoken» but i can not reproduce on last 3.15.4 version .

DenisChenu

DenisChenu

2018-11-14 15:34

developer   ~49661

Yes, but i can't reproduce .

I fix the PHP Warning issue : https://github.com/LimeSurvey/LimeSurvey/commit/049517fb28925db461dab6942db229873071982f
But : you come here , because there are a SESSION issue : https://github.com/LimeSurvey/LimeSurvey/blob/049517fb28925db461dab6942db229873071982f/application/controllers/survey/index.php#L235 :(

riqcles

riqcles

2018-11-14 15:39

reporter   ~49662

ok i see this night :)

Mazi

Mazi

2019-02-20 09:51

updater   ~50646

@riqcles, is this still an issue with the latest version?

cdorin

cdorin

2019-03-08 12:11

reporter   ~50843

@riqcles, any updates?

riqcles

riqcles

2019-03-18 16:25

reporter   ~51035

Sorry for the time. Same issue

riqcles

riqcles

2019-03-18 16:26

reporter   ~51036

With AJAX or not :

PHP notice

Undefined index: s_lang

/applis/apache-2.4.33/htdocs/limesurveyfuture/application/helpers/frontend_helper.php(758)

746 $thissurvey = getSurveyInfo($surveyid, $sLangCode);
747 $oTemplate = Template::model()->getInstance('', $surveyid);
748 App()->getController()->sTemplate = $oTemplate->sTemplateName; // It's going to be hard to be sure this is used ....
749 $sTemplateViewPath = $oTemplate->viewPath;
750
751
752 // Reset all the session variables and start again
753 resetAllSessionVariables($surveyid);
754
755 // NOTE: All of this is already done in survey controller.
756 // We keep it here only for Travis Tested thar are still not using Selenium
757 // As soon as the tests are rewrote to use selenium, those lines can be removed
758 $lang = $SESSION['survey'.$surveyid]['s_lang'];
759 if (empty($lang)){
760
761 // Multi lingual support order : by REQUEST, if not by Token->language else by survey default language
762
763 if (returnGlobal('lang', true)) {
764 $language_to_set = returnGlobal('lang', true);
765 } elseif (isset($oTokenEntry) && $oTokenEntry) {
766 // If survey have token : we have a $oTokenEntry
767 // Can use $oTokenEntry = Token::model($surveyid)->findByAttributes(array('token'=>$clienttoken)); if we move on another function : this par don't validate the token validity
768 $language_to_set = $oTokenEntry->language;
769 } else {
770 $language_to_set = $thissurvey['language'];

Stack Trace
#0

/applis/apache-2.4.33/htdocs/limesurveyfuture/application/helpers/SurveyRuntimeHelper.php(662): buildsurveysession(627969)

657 {
658
659 // First time the survey is loaded
660 if (!isset($_SESSION[$this->LEMsessid]['step']) || ($this->previewquestion || $this->previewgrp) ) {
661 // Init session, randomization and filed array
662 buildsurveysession($this->iSurveyid);
663 $fieldmap = randomizationGroupsAndQuestions($this->iSurveyid);
664 initFieldArray($this->iSurveyid, $fieldmap);
665
666 // Check surveyid coherence
667 if ($this->iSurveyid != LimeExpressionManager::getLEMsurveyId()) {

#1

/applis/apache-2.4.33/htdocs/limesurveyfuture/application/helpers/SurveyRuntimeHelper.php(529): SurveyRuntimeHelper->initFirstStep()

524 + Is the survey finished?
525
+ Are all the answer validated? (like: participant didn't answered to a mandatory question)
526 */
527 private function initMove()
528 {
529 $this->initFirstStep(); // If it's the first time user load this survey, will init session and LEM
530 $this->initTotalAndMaxSteps();
531 $this->checkIfUseBrowserNav(); // Check if user used browser navigation, or relaoded page
532 if ($this->sMove != 'clearcancel' && $this->sMove != 'confirmquota') {
533 $this->checkPrevStep(); // Check if prev step is set, else set it
534 $this->setMoveResult();

#2

/applis/apache-2.4.33/htdocs/limesurveyfuture/application/helpers/SurveyRuntimeHelper.php(104): SurveyRuntimeHelper->initMove()

099 if (!isset($_SESSION[$this->LEMsessid]['step'])) {
100 $this->showTokenOrCaptchaFormsIfNeeded();
101 }
102
103 $this->checkForDataSecurityAccepted();
104 $this->initMove(); // main methods to init session, LEM, moves, errors, etc
105 if (!$this->previewgrp && !$this->previewquestion) {
106 $this->checkQuotas(); // check quotas (then the process will stop here)
107 $this->displayFirstPageIfNeeded();
108 $this->saveAllIfNeeded();
109 $this->saveSubmitIfNeeded();

#3
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/application/controllers/survey/index.php(591): SurveyRuntimeHelper->run("627969", array("surveyid" => "627969", "thissurvey" => array("htmlemail" => "Y", "format" => "G", "template" => "vanilla", "language" => "fr", ...), "thisstep" => null, "tokensexist" => 0, ...))
#4
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/application/controllers/survey/index.php(24): index->action()
#5
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/framework/web/actions/CAction.php(76): index->run()
#6
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/framework/web/CController.php(308): CAction->runWithParams(array("sid" => "627969"))
#7
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/framework/web/CController.php(286): CController->runAction(index)
#8
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/framework/web/CController.php(265): CController->runActionWithFilters(index, array())
#9
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/framework/web/CWebApplication.php(282): CController->run("index")
#10
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/framework/web/CWebApplication.php(141): CWebApplication->runController("survey/index/sid/627969")
#11
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/framework/base/CApplication.php(185): CWebApplication->processRequest()
#12
+
/applis/apache-2.4.33/htdocs/limesurveyfuture/index.php(194): CApplication->run()
2019-03-18 15:12:02 Apache/2.4.33 (Unix) PHP/7.2.4 Yii Framework/1.1.20

riqcles

riqcles

2019-03-18 16:26

reporter   ~51037

I see this for the template : Material (see the snapshot)

riqcles

riqcles

2019-03-19 14:16

reporter   ~51053

I just tested with a blank database and I do not have the problem.
I have a version 2.73 with data that I test in migration to 3.x (currently 3.18).
I will check all questionnaires that contain quotas to see if url address was filled out or not (previous community fix).

You can close the bug if I am the only one to have this problem.
Envoyer des commentaires
Historique
Enregistré
Communauté

Mazi

Mazi

2019-04-04 15:21

updater   ~51340

I can reproduce this issue. At our survey we set a screen out quota with a limit of 0 for answer "yes". With Ajax mode activated I got redirected to the survey start page when clicking next. With disabled Ajax mode everything works as expected.

Mazi

Mazi

2019-04-04 15:27

updater   ~51342

It looks like the URL I set (to the panel provider) gets called but afterwards the survey seems to re-load.

DenisChenu

DenisChenu

2019-04-04 15:31

developer   ~51343

I can reproduce this issue. At our survey we set a screen out quota with a limit of 0 for answer "yes". With Ajax mode activated I got redirected to the survey start page when clicking next. With disabled Ajax mode everything works as expected.

We already have this issue , and it's not the same issue. If you still have it in last version : report a new issue.

Mazi

Mazi

2019-04-04 16:04

updater   ~51346

@DenisChenu, can you point me to that ticket? I just tested with the latest version so it should be re-opened.
I wasn't aware that it is not the same, it sounded pretty similar but "je nes parles pas Francais tres bien".

DenisChenu

DenisChenu

2019-04-04 17:06

developer   ~51351

The fix is here : https://github.com/LimeSurvey/LimeSurvey/commit/e72bafce4e84c82324588ff5b8a0962c133a9693#diff-063845c64fbc16b55aa389eaf2f6e07b
But : since there are more than bug that cvan be searched : i use same tool then you … https://bugs.limesurvey.org/view_all_bug_page.php
ajax => markusfluer for Assigned to.

Else here : this report is about quota and php notive, your is direcly linked to end url (and redirection)

c_schmitz

c_schmitz

2020-03-06 00:54

administrator   ~56345

This version of LimeSurvey is not longer supported. Please check so that the issue is fixed in a more recent version of LimeSurvey. If it's not, reopen this bug report. Thank you.

Issue History

Date Modified Username Field Change
2018-11-14 14:57 riqcles New Issue
2018-11-14 14:57 riqcles File Added: V3_boucle_limesurvey_survey_627969.lss
2018-11-14 14:57 riqcles Note Added: 49656
2018-11-14 14:58 riqcles Note Added: 49657
2018-11-14 14:58 DenisChenu Note Added: 49658
2018-11-14 15:00 DenisChenu Assigned To => DenisChenu
2018-11-14 15:00 DenisChenu Status new => assigned
2018-11-14 15:02 riqcles Note Added: 49659
2018-11-14 15:04 DenisChenu Assigned To DenisChenu =>
2018-11-14 15:04 DenisChenu Status assigned => new
2018-11-14 15:04 DenisChenu Note Added: 49660
2018-11-14 15:34 DenisChenu Note Added: 49661
2018-11-14 15:39 riqcles Note Added: 49662
2019-02-20 09:51 Mazi Note Added: 50646
2019-03-08 12:11 cdorin Status new => feedback
2019-03-08 12:11 cdorin Note Added: 50843
2019-03-18 16:25 riqcles Note Added: 51035
2019-03-18 16:25 riqcles Status feedback => new
2019-03-18 16:26 riqcles Note Added: 51036
2019-03-18 16:26 riqcles Note Added: 51037
2019-03-18 16:27 riqcles File Added: 2019-03-18 16_23_00-limesurvey_Quotas_Templates.png
2019-03-19 14:16 riqcles Note Added: 51053
2019-04-04 15:21 Mazi Assigned To => Mazi
2019-04-04 15:21 Mazi Status new => acknowledged
2019-04-04 15:21 Mazi Note Added: 51340
2019-04-04 15:22 Mazi Priority none => high
2019-04-04 15:22 Mazi Reproducibility have not tried => always
2019-04-04 15:23 Mazi Assigned To Mazi => markusfluer
2019-04-04 15:24 Mazi Relationship added related to 14616
2019-04-04 15:26 Mazi File Added: Screenshot_4.png
2019-04-04 15:27 Mazi Note Added: 51342
2019-04-04 15:31 DenisChenu Note Added: 51343
2019-04-04 16:04 Mazi Note Added: 51346
2019-04-04 17:06 DenisChenu Note Added: 51351
2019-09-23 12:18 c_schmitz Status acknowledged => confirmed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2020-03-06 00:54 c_schmitz Status confirmed => closed
2020-03-06 00:54 c_schmitz Resolution open => unable to reproduce
2020-03-06 00:54 c_schmitz Note Added: 56345