View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
14157Bug reportsOtherpublic2026-11-20 12:33
ReporterDenisChenu Assigned To 
PrioritynormalSeverityminor 
Status acknowledgedResolutionopen 
Summary14157: 2 token dynamic model + 2 survey dynamic model
Description

Survey : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/SurveyDynamic.php + https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Response.php
Token : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Token.php + https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/TokenDynamic.php
Timeing : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Timing.php + https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/SurveyTimingDynamic.php

Steps To Reproduce

Think best is to have only Response + Token + Timing each extend Dynamic

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & version
Server OS (if known)
Webserver software & version (if known)
PHP Version
Git branch / Pull Request URLhttps://github.com/LimeSurvey/LimeSurvey/pull/5581

Relationships

related to 14251 closedDenisChenu When deleting a token : CPDB keep link with survey 

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2018-11-26 13:36

reporter   ~49783

I'd prefer to start with "No function should be longer than 60 lines" if we want to refactor things.

DenisChenu

DenisChenu

2018-11-26 14:52

developer   ~49784

It's not really refactoring, but when we need to fix a function : where did we fix it preferably ?

One class can call another class, but if we go like this : next time we fix in a class, but not in other. And 2 month after : we get a new "same" bug

Choose quickly makes corrections in the right place, and add a call to good class on another one.

ollehar

ollehar

2018-11-26 15:41

reporter   ~49785

Sounds like code duplication?

DenisChenu

DenisChenu

2018-11-26 16:59

developer   ~49787

Yep, and have 2 model for same table => more chance of duplication …

In https://github.com/LimeSurvey/LimeSurvey/commit/3579c93e529792463e8b3fe44671830fe78d06f3#diff-9cfdc794610e572e6db5e2eca5e364bc : i choose to call a \Token function from \TokenDynamic , but maybe aothe dev want to call a \TokenDynamic from \Token .

If we choose : move step by step \Token to \TokenDynamic OR \TokenDynamic to \Token

it's better

Issue History

Date Modified Username Field Change
2018-10-19 17:25 DenisChenu New Issue
2018-11-13 23:50 DenisChenu Relationship added related to 14251
2018-11-26 13:36 ollehar Note Added: 49783
2018-11-26 14:52 DenisChenu Note Added: 49784
2018-11-26 15:41 ollehar Note Added: 49785
2018-11-26 16:59 DenisChenu Note Added: 49787
2021-09-17 11:10 ollehar Priority none => normal
2026-11-19 22:50 c_schmitz Status new => acknowledged
2026-11-20 12:33 c_schmitz Git branch / Pull Request URL => https://github.com/LimeSurvey/LimeSurvey/pull/5581