View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
19778Bug reportsOtherpublic2025-05-27 15:48
ReporterDenisChenu Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Product Version6.6.x 
Summary19778: getIsDateStamp return false with date stamped survey
Description

In survey settings : if you have datestamp globally tpo N and survey datestamp to Y : getIsDateStamp return false

Steps To Reproduce

Steps to reproduce

Import and activate included plugin
Check global survey settings datestamp to N
Group survey settings : datestamp to inherit
Create a survey
Activate survey : when activate : set datestamp to ON
Check plugin settings

Expected result

See Survey getIsDateStamp are : true and Survey options->datestamp are : Y

Actual result

See Survey getIsDateStamp are : false and Survey options->datestamp are : N

TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build)6.6.5
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2024-09-27 11:36

developer   ~81122

PS : i really don't understand all this code … https://github.com/LimeSurvey/LimeSurvey/blob/78a2949a70c0f98bb53882ccfd21a7faa27501ca/application/models/SurveysGroupsettings.php#L311

We end by survey : https://github.com/LimeSurvey/LimeSurvey/blob/78a2949a70c0f98bb53882ccfd21a7faa27501ca/application/models/SurveysGroupsettings.php#L362

But we need to start by survey, and not end by …
Why we don't have such issue before ?

DenisChenu

DenisChenu

2024-10-07 11:00

developer   ~81173

@tibor.pacalat : my solution here is a big rewrite of the system.

DenisChenu

DenisChenu

2025-02-18 11:09

developer   ~82058

I'm still unsure on the desired behavior …

Opinion:

Survey->datestamp must return Y/N or I
Survey->otions->datestamp must return only Y/N

?

DenisChenu

DenisChenu

2025-05-22 11:06

developer   ~82732

Last edited: 2025-05-22 11:07

@gabrieljenik : do you have an opinion here ?

Plugin can need to read if settings are inherited or not

In Survey settings part OK for

  • Survey->datestamp must return (Y|N|I)
  • Survey->options->datestamp must return only (Y|N) (only get parent if Survey->datestamp == "I")
  • Survey->getIsDateStamp must use options->datestamp

In Survey and all other controller : Survey->datestamp = Survey->options->datestamp

gabrieljenik

gabrieljenik

2025-05-23 23:19

manager   ~82754

Survey->datestamp must return (Y|N|I)

Agree. That is the survey data field.

Survey->options->datestamp must return only (Y|N) (only get parent if Survey->datestamp == "I")

I guess you talk about oOptions.
Agree. This is the value from the survey merged with the one inherited from the survey group hirearchy.
The value inheritance decision is executed here I think (from quick search) SurveysGroupsettings::shouldInherit()

Survey->getIsDateStamp must use options->datestamp

Agree.

In Survey and all other controller : Survey->datestamp = Survey->options->datestamp

Not sure I follow that statement.
datestamp and options->datestamp shouldn't be accessed much from outside Survey model.

Still, if the datestamp is Inherited, could end up Survey->datestamp <> Survey->options->datestamp

DenisChenu

DenisChenu

2025-05-26 08:44

developer   ~82757

In Survey and all other controller : Survey->datestamp = Survey->options->datestamp

Not sure I follow that statement.
datestamp and options->datestamp shouldn't be accessed much from outside Survey model.

It's the current situation : when you check Survey->datestamp in beforeSurveyPage or newExport for example : you get Survey->oOptions->datestamp . Updating this : we broke a lot of plugins !
Then : i's for don't update this situation.

Only update for beforeSurveySettings and newSurveySettings (seems the only situation where we have this issue) or when controller are SurveyAdministrationController

The upadte was here : https://github.com/LimeSurvey/LimeSurvey/blob/ec5825c1ce2c5d953b1f634e2e57e837c9df2c12/application/controllers/SurveyAdministrationController.php#L1923

gabrieljenik

gabrieljenik

2025-05-27 15:43

manager   ~82774

From what I read, I think the issue could be in 2 places maybe:

1) Inheritance Mechanism in SurveysGroupsettings::getInstance

2) The line you commented (https://github.com/LimeSurvey/LimeSurvey/blob/ec5825c1ce2c5d953b1f634e2e57e837c9df2c12/application/controllers/SurveyAdministrationController.php#L1923) maybe fecthing the instance from the cache and then setting the options for the instance in the cache, whereas in other places options should be set from inheritance.

Will debug and be back

DenisChenu

DenisChenu

2025-05-27 15:48

developer   ~82775

Inheritance Mechanism in SurveysGroupsettings::getInstance

This one is very strange ....

Issue History

Date Modified Username Field Change
2024-09-27 11:34 DenisChenu New Issue
2024-09-27 11:34 DenisChenu File Added: DateStampSettingsIssue.zip
2024-09-27 11:34 DenisChenu File Added: Capture d’écran du 2024-09-27 11-31-55.png
2024-09-27 11:36 DenisChenu Note Added: 81122
2024-09-27 11:36 DenisChenu Bug heat 0 => 2
2024-10-02 17:02 tibor.pacalat Assigned To => DenisChenu
2024-10-02 17:02 tibor.pacalat Status new => assigned
2024-10-07 11:00 DenisChenu Note Added: 81173
2025-02-18 11:09 DenisChenu Note Added: 82058
2025-05-22 11:06 DenisChenu Assigned To DenisChenu => gabrieljenik
2025-05-22 11:06 DenisChenu Status assigned => feedback
2025-05-22 11:06 DenisChenu Note Added: 82732
2025-05-22 11:07 DenisChenu Note Edited: 82732
2025-05-23 23:19 gabrieljenik Note Added: 82754
2025-05-23 23:19 gabrieljenik Bug heat 2 => 4
2025-05-26 08:44 DenisChenu Note Added: 82757
2025-05-26 08:44 DenisChenu Status feedback => assigned
2025-05-27 15:43 gabrieljenik Note Added: 82774
2025-05-27 15:48 DenisChenu Note Added: 82775