View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
09307Bug reportsSurvey participants (Tokens)public2014-11-10 12:49
ReporterDLange Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary09307: Calling a survey with a non-existing token leads to PHP Warning (debug=1)
Description

Set debug=1 results in
Trying to get property of non-object
PHP warning/notice

Steps To Reproduce

Set debug=1
Open .../survey/index/sid/{existing-sid}/token/{NON-existing-token}/lang/de in a web browser
-> PHP Notice + stack trace

Additional Information

PHP notice

Trying to get property of non-object

/var/www/application/controllers/survey/index.php(380)

368 }
369 if ($tokensexist == 1 && isset($token) && $token!="" && tableExists("{{tokens_".$surveyid."}}") && !$previewmode) //check if token is in a valid time frame
370 {
371 // check also if it is allowed to change survey after completion
372 if ($thissurvey['alloweditaftercompletion'] == 'Y' ) {
373 $tokenInstance = Token::model($surveyid)->editable()->findByAttributes(array('token' => $token));
374 } else {
375 $tokenInstance = Token::model($surveyid)->usable()->incomplete()->findByAttributes(array('token' => $token));
376 }
377 if (!isset($tokenInstance))
378 {
379 $tk = Token::model($surveyid)->findByAttributes(array('token' => $token));
380 if($tk->completed == 'N')
381 {
382 $now = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", Yii::app()->getConfig("timeadjust"));
383 if(strtotime($now) < strtotime($tk->validfrom))
384 {
385 $err = $clang->gT("This invitation is not valid yet.");
386 }
387 else
388 {
389 $err = $clang->gT("This invitation is not valid anymore.");
390 }
391 }
392 else

Stack Trace
#0

/var/www/application/controllers/survey/index.php(47): index->action()

42 App()->getClientScript()->render($buffer);
43 App()->getClientScript()->reset();
44 return $buffer;
45 });
46 ob_implicit_flush(false);
47 $this->action();
48 ob_flush();
49 }
50
51 function action()
52 {

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)2.05+ (141003)
I will donate to the project if issue is resolvedNo
Browser
Database type & versionnot applicable
Server OS (if known)not applicable
Webserver software & version (if known)n
PHP Version5.4.4

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2014-10-23 10:09

developer   ~30856

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

DenisChenu

DenisChenu

2014-10-26 11:18

developer   ~30864

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

c_schmitz

c_schmitz

2014-11-10 12:49

administrator   ~30934

Version 2.05 Build 141110 released

Related Changesets

LimeSurvey: master 6294082e

2014-10-23 08:09:16

DenisChenu

Details Diff
Fixed issue 09307: Calling a survey with a non-existing token leads to PHP Warning (debug=1)
Dev: $oToken can be null
Affected Issues
09307
mod - application/controllers/survey/index.php Diff File

LimeSurvey: 2.06 ed9003f6

2014-10-26 10:18:33

DenisChenu

Details Diff
Fixed issue 09307: Calling a survey with a non-existing token leads to PHP Warning (debug=1)
Dev: $oToken can be null
Dev: Fix some merging error (b5142e78a2d006a8b73b38347af4229b6a9027f6 child)
Affected Issues
09307
mod - application/controllers/survey/index.php Diff File
mod - application/helpers/frontend_helper.php Diff File
mod - application/helpers/surveytranslator_helper.php Diff File
mod - application/views/admin/survey/editSurvey_view.php Diff File
mod - application/views/admin/survey/subview/tabNotification_view.php Diff File

Issue History

Date Modified Username Field Change
2014-10-16 22:55 DLange New Issue
2014-10-23 09:47 DenisChenu Assigned To => DenisChenu
2014-10-23 09:47 DenisChenu Status new => assigned
2014-10-23 10:09 DenisChenu Changeset attached => LimeSurvey master 6294082e
2014-10-23 10:09 DenisChenu Note Added: 30856
2014-10-23 10:09 DenisChenu Resolution open => fixed
2014-10-23 10:10 DenisChenu Status assigned => resolved
2014-10-23 10:10 DenisChenu Fixed in Version => 2.05+
2014-10-26 11:18 DenisChenu Changeset attached => LimeSurvey 2.06 ed9003f6
2014-10-26 11:18 DenisChenu Note Added: 30864
2014-11-10 12:49 c_schmitz Note Added: 30934
2014-11-10 12:49 c_schmitz Status resolved => closed
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)