View Issue Details

IDProjectCategoryView StatusLast Update
12865Development Otherpublic2017-12-04 12:00
ReporterDenisChenuAssigned Toolle 
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Product Version2.5x 
Target VersionFixed in Version 
Summary12865: Unable to use createFieldMap in console
DescriptioncreateFieldMap function is used for … a lot of thing, but we are unable to use it in console because this function use Yii::app()->session
Steps To ReproduceCreate a plugin or a console controller and add createFieldMap function call
TagsNo tags attached.

Activities

DenisChenu

DenisChenu

2017-11-02 18:19

developer   ~44936

See https://framagit.org/snippets/860 for a quick plugin example.
Set $aSurveys to existing var.

Currently i redo a helpers/common but then : need to copy/paste a lot lot lot of function …
Mazi

Mazi

2017-11-03 09:08

developer   ~44937

We are using these lines for faking a session:

// Faking a session here.
Yii::app()->setComponent('session',array('class'=>'CHttpSession',),true);
Yii::app()->session->open();
 Yii::app()->session['loginID']=1;
DenisChenu

DenisChenu

2017-11-03 09:41

developer   ~44938

Great, i give it a trye :).

Still : i think we must remove session usage in createFieldMap : use Cache (some specific cache)
olle

olle

2017-12-01 13:58

administrator   ~45218

Was just about to say what Mazi said: Just hack into $_SESSION.
olle

olle

2017-12-01 13:59

administrator   ~45219

I do that in the unit tests, too.
DenisChenu

DenisChenu

2017-12-01 14:02

developer   ~45220

Because : i think we really need a fieldMap without any session/user related system.
fieldMap for export for example .
And with a fieldMap unrelated to session and user : we can start a real cache system. This fieldMap function can take a really long time, make a big session file. If you hav 20 user at same time : i really think a lot of part can goes in a real cache and improve speed.

It's a Development mantis, not a bug
Mazi

Mazi

2017-12-01 14:17

developer   ~45223

If we talk about the very useful fieldmap: How about adding a function to LS API for easily getting the fieldmap for a given survey ID?
That was planned a while ago and will be pretty useful for others.
olle

olle

2017-12-04 11:04

administrator   ~45230

Can I close this? This is a feature request IMO, not a bug.
DenisChenu

DenisChenu

2017-12-04 11:11

developer   ~45231

@olle : it's not in bug , nether in feature request … it's Project/Development . Development is more (for me) : make it better for reusage/understand/adapt … but this don't fix bug or add new feature …
olle

olle

2017-12-04 11:56

administrator   ~45240

I see. I thought "Development" was for LS 3 only, sorry.
DenisChenu

DenisChenu

2017-12-04 12:00

developer   ~45241

Oh non, really more old :)

Issue History

Date Modified Username Field Change
2017-11-02 18:17 DenisChenu New Issue
2017-11-02 18:19 DenisChenu Note Added: 44936
2017-11-03 09:08 Mazi Note Added: 44937
2017-11-03 09:41 DenisChenu Note Added: 44938
2017-12-01 13:58 olle Note Added: 45218
2017-12-01 13:59 olle Note Added: 45219
2017-12-01 14:02 DenisChenu Note Added: 45220
2017-12-01 14:17 Mazi Note Added: 45223
2017-12-04 11:04 olle Note Added: 45230
2017-12-04 11:04 olle Assigned To => olle
2017-12-04 11:04 olle Status new => feedback
2017-12-04 11:11 DenisChenu Note Added: 45231
2017-12-04 11:11 DenisChenu Status feedback => assigned
2017-12-04 11:56 olle Note Added: 45240
2017-12-04 12:00 DenisChenu Note Added: 45241