View Issue Details

This issue affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
08652Bug reportsTheme editorpublic2021-03-04 16:59
Reportermdekker Assigned Tomdekker  
PrioritynormalSeverityminor 
Status assignedResolutionopen 
Product Version2.05+ 
Summary08652: Refactor code to get template info from getSurveyInfo
Description

At the moment getSurveyInfo returns an array with two keys that have the same value: template and templatedir. All code using this info will try to render that to a template, default template etc.

This is a mess for code and a source of error. This needs to be centralized, and by doing that we can also get a better event to modify that information at runtime by a plugin. The current event beforeSurveyPage allows to change the template, but that info needs to persist in the getSurveyInfo method.

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)140203
I will donate to the project if issue is resolvedNo
Browser
Database type & version.
Server OS (if known).
Webserver software & version (if known).
PHP Version.
Git branch / Pull Request URL

Relationships

related to 08553 closedDenisChenu Feature requests beforeSurveyPage lack of get event 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2014-02-13 20:17

developer   ~28719

You mean 2 new event

  • beforeGetSurveyInfo event
  • afterGetSurveyInfo event
    ?

Not sure it's really a good idea to have so many event ?

sammousa

sammousa

2014-04-29 15:07

reporter   ~29903

Why not just have use Survey::model()->findByPk ?

All information should be available from the active record anyway.
Then we can use that model to fire some plugin events if required.

I dont see the need for this global function.

mdekker

mdekker

2014-04-29 16:59

reporter   ~29904

The global function already exists and is used in a lot of places, that's why. When moving away from that function that means a ton of extra database calls to read the info since it is used in the code in a lot of places.

It is a global helper now, but can also be moved to the survey model to keep it at a better place. And ofcourse there is room for improvement of the method itself.

One improvement (that i porpose here) would be to move the checks if a template exists to the getsurveyinfo function/method. That way the check will only be done once and persist during the request.

Mazi

Mazi

2015-06-12 14:32

updater   ~32339

What's the current status of this issue.

@Sam, is that something which is on your radar for LS3 or are the related code parts not touched by LS3 at all?

DenisChenu

DenisChenu

2021-03-04 16:59

developer   ~62722

https://manual.limesurvey.org/AfterFindSurvey ?

Issue History

Date Modified Username Field Change
2014-02-03 10:44 mdekker New Issue
2014-02-03 10:44 mdekker Status new => assigned
2014-02-03 10:44 mdekker Assigned To => mdekker
2014-02-13 20:17 DenisChenu Note Added: 28719
2014-03-02 22:49 c_schmitz Project Bug reports => @10@
2014-04-29 15:07 sammousa Note Added: 29903
2014-04-29 16:59 mdekker Note Added: 29904
2015-06-12 14:32 Mazi Note Added: 32339
2015-06-15 23:37 DenisChenu Relationship added related to 08553
2015-12-11 14:40 c_schmitz Category Templates => Theme editor
2021-03-04 16:59 DenisChenu Note Added: 62722