View Issue Details

This bug affects 1 person(s).
 12
IDProjectCategoryView StatusLast Update
18630Bug reportsSurvey editingpublic2023-07-03 16:37
Reporterc_schmitz Assigned Totibor.pacalat  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version5.6.x 
Summary18630: Survey list showing wrong icon for surveys
Description

Surveys having a start date set in the past and no expiration date display wrong icon in the survey list.
The red 'expired' icon is shown, instead of the normal 'Running' icon.

Steps To Reproduce

Steps to reproduce

Set a start date in the past on a survey, activate it, look at it in the survey list.

Expected result

Normal green icon should be shown as status in the survey list. (meaning it is running)

Actual result

Red 'expired' status icon is shown.
(Write here what happened instead)

TagsNo tags attached.
Bug heat12
Complete LimeSurvey version number (& build)5.6.4
I will donate to the project if issue is resolvedNo
Browser
Database type & versionn/a
Server OS (if known)
Webserver software & version (if known)
PHP Versionn/a

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2023-03-02 16:04

manager   ~74010

Last edited: 2023-03-02 19:51

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


The icon was failing only when time adjust was NOT zero, as then sExpired was null and sNow was todays, but adjusted.
When that happened: oStop was set to now and sNow was set to Now but adjusted. That made the bExpired to be true.

Created tests.
Did a small change to fix the situation, and avoid using the "sometimes-wrongly-calculated" value.

These needs to be reviewed a bit more as there is a lot of duplicated code.
Started a reorganization draft but will pick up later: https://github.com/LimeSurvey/LimeSurvey/pull/2957

So far, with this I think is a good starter.

  • Fix
  • No reorg
  • Tests (which will be usefull for making sure future reorg is ok)
DenisChenu

DenisChenu

2023-03-02 19:19

developer   ~74014

I don't really understand the fix ?

DenisChenu

DenisChenu

2023-03-02 19:22

developer   ~74015

I can not reproduce …

DenisChenu

DenisChenu

2023-03-02 19:23

developer   ~74016

With time adjust 0 or 1 : no change … :(

gabrieljenik

gabrieljenik

2023-03-02 19:27

manager   ~74017

I will explain in a while... It is tricky and now I got confised myself :)

gabrieljenik

gabrieljenik

2023-03-02 19:52

manager   ~74019

The icon was failing only when time adjust was NOT zero (and positive), as then sExpired was null and sNow was todays, but adjusted.
When that happened: oStop was set to now and sNow was set to Now but adjusted. That made the bExpired to be true.

That code was kind of fixed on getState(), so a reorganization is needed.
We made the fix on 1 PR and then a reorganization (still need to adjust a bit) on another.

DenisChenu

DenisChenu

2023-03-02 19:56

developer   ~74020

OK : i got it :)

Testing now

guest

guest

2023-03-22 12:34

viewer   ~74222

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

tibor.pacalat

tibor.pacalat

2023-06-12 16:15

administrator   ~75556

Last edited: 2023-06-12 17:54

I also managed to reproduce it on develop:

  1. create a survey, set start date in the past (timeadjust: 0)
  2. activate it
  3. change timeadjust to 7
  4. It shows as "Expired"
gabrieljenik

gabrieljenik

2023-06-20 18:21

manager   ~75750

PR for master
https://github.com/LimeSurvey/LimeSurvey/pull/3232

After accepted will do for v5.

c_schmitz

c_schmitz

2023-06-29 15:26

administrator   ~75907

Merged 6.x patch

guest

guest

2023-06-29 15:32

viewer   ~75908

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

guest

guest

2023-06-29 15:32

viewer   ~75909

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

gabrieljenik

gabrieljenik

2023-06-30 20:28

manager   ~75914

Couldn't reproduce it on v5.
I think it is ok to close. @tibor.pascalet ?

LimeBot

LimeBot

2023-07-03 10:43

administrator   ~75917

Fixed in Release 6.1.6+230703

tibor.pacalat

tibor.pacalat

2023-07-03 16:37

administrator   ~75923

Yeah, I can't reproduce it in 5.x either, closing this one.

Related Changesets

LimeSurvey: master 40e74c22

2023-03-22 13:34

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 18630: Survey list showing wrong icon for surveys. (#2960)

Co-authored-by: Lapiu Dev <devgit@lapiu.biz>
Affected Issues
18630
mod - application/models/Survey.php Diff File
mod - tests/unit/models/SurveyTest.php Diff File

LimeSurvey: master 5fef2965

2023-06-29 17:25

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 18630: Survey list showing wrong icon for surveys. (#3232) Affected Issues
18630
mod - application/models/Survey.php Diff File
mod - tests/unit/models/SurveyTest.php Diff File

LimeSurvey: master 5fef2965

2023-06-29 17:25

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 18630: Survey list showing wrong icon for surveys. (#3232) Affected Issues
18630
mod - application/models/Survey.php Diff File
mod - tests/unit/models/SurveyTest.php Diff File

Issue History

Date Modified Username Field Change
2023-02-09 09:51 c_schmitz New Issue
2023-02-09 09:51 c_schmitz Assigned To => gabrieljenik
2023-02-09 09:51 c_schmitz Status new => assigned
2023-02-09 09:54 c_schmitz Priority none => normal
2023-03-02 16:04 gabrieljenik Assigned To gabrieljenik => DenisChenu
2023-03-02 16:04 gabrieljenik Status assigned => ready for code review
2023-03-02 16:04 gabrieljenik Note Added: 74010
2023-03-02 16:04 gabrieljenik Bug heat 0 => 2
2023-03-02 19:19 DenisChenu Status ready for code review => in code review
2023-03-02 19:19 DenisChenu Note Added: 74014
2023-03-02 19:19 DenisChenu Bug heat 2 => 4
2023-03-02 19:22 DenisChenu Note Added: 74015
2023-03-02 19:22 DenisChenu File Added: survey_archive_427567-date.lsa
2023-03-02 19:22 DenisChenu File Added: Capture d’écran du 2023-03-02 19-21-11.png
2023-03-02 19:22 DenisChenu File Added: Capture d’écran du 2023-03-02 19-21-41.png
2023-03-02 19:23 DenisChenu Note Added: 74016
2023-03-02 19:24 gabrieljenik Note Edited: 74010
2023-03-02 19:25 gabrieljenik Note Edited: 74010
2023-03-02 19:27 gabrieljenik Note Added: 74017
2023-03-02 19:40 gabrieljenik Note Edited: 74010
2023-03-02 19:51 gabrieljenik Note Edited: 74010
2023-03-02 19:52 gabrieljenik Note Added: 74019
2023-03-02 19:56 DenisChenu Note Added: 74020
2023-03-02 19:56 DenisChenu Assigned To DenisChenu => c_schmitz
2023-03-02 19:56 DenisChenu Status in code review => ready for testing
2023-03-14 15:29 gabrieljenik Assigned To c_schmitz => ollehar
2023-03-14 15:29 gabrieljenik Status ready for testing => ready for merge
2023-03-22 12:34 Changeset attached => LimeSurvey master 40e74c22
2023-03-22 12:34 guest Note Added: 74222
2023-03-22 12:34 guest Bug heat 4 => 6
2023-03-22 12:34 ollehar Status ready for merge => resolved
2023-03-22 12:34 ollehar Resolution open => fixed
2023-06-12 16:15 tibor.pacalat Note Added: 75556
2023-06-12 16:15 tibor.pacalat Bug heat 6 => 8
2023-06-12 16:18 tibor.pacalat Note Edited: 75556
2023-06-12 16:23 tibor.pacalat Note Edited: 75556
2023-06-12 17:54 tibor.pacalat Note Edited: 75556
2023-06-12 18:03 gabrieljenik Assigned To ollehar => gabrieljenik
2023-06-12 18:03 gabrieljenik Status resolved => assigned
2023-06-20 18:21 gabrieljenik Note Added: 75750
2023-06-20 18:22 gabrieljenik Assigned To gabrieljenik => DenisChenu
2023-06-20 18:22 gabrieljenik Status assigned => ready for code review
2023-06-22 08:25 DenisChenu Assigned To DenisChenu =>
2023-06-22 08:25 DenisChenu Status ready for code review => ready for testing
2023-06-23 17:01 gabrieljenik Assigned To => gabrieljenik
2023-06-23 17:01 gabrieljenik Status ready for testing => ready for merge
2023-06-23 17:01 gabrieljenik Assigned To gabrieljenik => tibor.pacalat
2023-06-29 15:25 c_schmitz Assigned To tibor.pacalat => gabrieljenik
2023-06-29 15:26 c_schmitz Status ready for merge => assigned
2023-06-29 15:26 c_schmitz Note Added: 75907
2023-06-29 15:26 c_schmitz Bug heat 8 => 10
2023-06-29 15:32 Changeset attached => LimeSurvey master 5fef2965
2023-06-29 15:32 Changeset attached => LimeSurvey master 5fef2965
2023-06-29 15:32 guest Note Added: 75908
2023-06-29 15:32 guest Note Added: 75909
2023-06-30 20:28 gabrieljenik Note Added: 75914
2023-06-30 20:29 gabrieljenik Assigned To gabrieljenik => tibor.pacalat
2023-06-30 20:29 gabrieljenik Status assigned => feedback
2023-07-03 10:43 LimeBot Note Added: 75917
2023-07-03 10:43 LimeBot Status feedback => closed
2023-07-03 10:43 LimeBot Bug heat 10 => 12
2023-07-03 16:37 tibor.pacalat Note Added: 75923