View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
17230Bug reports_ Unknownpublic2021-07-12 11:53
Reportermfcsita Assigned Toc_schmitz  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.4.15 
Summary17230: Inconsistent 'willRun' state of the survey when Start date is undefined
Description

Hi,
the method Survey::getState() can return the state 'willRun'; apparently 'willRun' should return when the survey is active and the start date is in the future. If the survey is active without a start date it should return 'willExpire'.
The code says:

// now with timeadjust correction
$sNow = date("Y-m-d H:i:s", strtotime(Yii::app()->getConfig('timeadjust'), strtotime(date("Y-m-d H:i:s"))));
...
// null if start date is empty
$sStart = ($this->startdate != '') ? date("Y-m-d H:i:s", strtotime(Yii::app()->getConfig('timeadjust'), strtotime($this->startdate))) : null;
...
// now without any correction if $sStart is null
$oStart = new DateTime($sStart);
...
// inconsistent, $oStart could be before o after $oNow based on correction
$bWillRun = (!is_null($oStart) && $oStart > $oNow);

I think the last line should be:
$bWillRun = (!is_null($sStart) && $oStart > $oNow);

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)4.4.15
I will donate to the project if issue is resolvedNo
Browser
Database type & versionany
Server OS (if known)
Webserver software & version (if known)
PHP Versionany

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2021-04-07 08:01

administrator   ~63844

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=31547

c_schmitz

c_schmitz

2021-04-07 08:02

administrator   ~63845

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

c_schmitz

c_schmitz

2021-04-07 08:02

administrator   ~63846

Thank you!

c_schmitz

c_schmitz

2021-07-12 11:53

administrator   ~65370

Release done.

Related Changesets

LimeSurvey: 3.x-LTS 32ddd29a

2021-04-07 08:00:54

c_schmitz

Details Diff
Fixed issue 17230: Inconsistent 'willRun' state of the survey when Start date is undefined Affected Issues
17230
mod - application/models/Survey.php Diff File

LimeSurvey: master 76f707d6

2021-04-07 08:00:54

c_schmitz

Details Diff
Fixed issue 17230: Inconsistent 'willRun' state of the survey when Start date is undefined Affected Issues
17230
mod - application/models/Survey.php Diff File

Issue History

Date Modified Username Field Change
2021-04-06 22:26 mfcsita New Issue
2021-04-07 08:01 c_schmitz Changeset attached => LimeSurvey 3.x-LTS 32ddd29a
2021-04-07 08:01 c_schmitz Note Added: 63844
2021-04-07 08:01 c_schmitz Assigned To => c_schmitz
2021-04-07 08:01 c_schmitz Resolution open => fixed
2021-04-07 08:02 c_schmitz Changeset attached => LimeSurvey master 76f707d6
2021-04-07 08:02 c_schmitz Note Added: 63845
2021-04-07 08:02 c_schmitz Status new => resolved
2021-04-07 08:02 c_schmitz Note Added: 63846
2021-07-12 11:53 c_schmitz Note Added: 65370
2021-07-12 11:53 c_schmitz Status resolved => closed