View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|15224||Bug reports||Plugins||public||2019-09-04 15:08||2021-02-02 15:20|
|Fixed in Version||4.3.16|
|Summary||15224: newQuestionAttributes deprecated : need a replacer|
|Description||newQuestionAttributes still here, but new attributes are not shown in Question editor|
|Steps To Reproduce||https://gitlab.com/SondagesPro/QuestionSettingsType/addScriptToQuestion|
Install , and look at any question
|Additional Information||newQuestionAttributes event are really a great solution …|
**need** a replacement
Manual page for redesign: https://manual.limesurvey.org/Question_attributes_redesign
|Tags||No tags attached.|
|Complete LimeSurvey version number (& build)||4.0.0 github RC3 fcaab028d4|
|I will donate to the project if issue is resolved||No|
|Database & DB-Version||mariadb|
|Server OS (if known)||fedora/linux|
|Webserver software & version (if known)||nginx|
|related to||14723||assigned||cdorin||Development||Global attribute or question dependance|
|related to||15543||closed||Bug reports||Document changes in plugin API for question attributes|
|related to||15776||new||Feature requests||Allow cleaner options system for options in question attributes|
|related to||14893||assigned||cdorin||Development||Core attribute XML need optionnal value : mus allow empty value|
|related to||08750||new||Development||Timer attribute : need to move to external js and css for default|
|parent of||17049||closed||ollehar||Bug reports||newQuestionAttributes event didn't add attribute|
|has duplicate||16675||closed||cdorin||Bug reports||Array Type:F: Question attributes are not saved|
|related to||14248||new||Feature requests||Allow survey theme to add (and use) question attribute|
|related to||16669||closed||gabrieljenik||Bug reports||getQuestionAttributes function don't get the plugins attribute|
Still no way to add an attribute in core Question ?
Still no way to have a replacer (or fix current plugin settings).
on last git version.
|My suggestion: Add the same event.|
|Not sure if I got the bug report right but being able to add your own question attributes by a plugin is essential for plugin development!|
@Mazi : I think you understand the issue here : **no way** to have Custom Question attributes by plugins in current develop :).
You can add QuestionAttribute : but it don't show any input in admin GUI part.
|Looks like there's no "single point of entry" to fetch question attributes anymore. Sucks ass.|
|Found it. Event needs to be moved to getQuestionThemeAttributeValues in questionHelper.|
|Re-added the event, but needs more testing and fixing (attributes are not saved, etc).|
|Your plugin needs to be updated to LS4 requirements to display advanced options properly. Would be nice to have it documented... E.g., the switch input type needs option array.|
No default on switch ?
Easy to fix :)
I look at it tomorrow : you can assign it to me for test :)
|I guess switch can be sometimes Y/N, sometimes 1/0, and there's no point doing a default then.|
In 3.X : seems there are a default 0/1 .
But i can send it in 4.X, not a problem (maybe need to update manaul …)
RE "Your plugin needs to be updated to LS4 requirements ": I am not sure about the details, but shouldn't plugins be compatible between v3.x and 4.x?
Is there some documentation for plugin developers regarding "LS4 requirements"?
> shouldn't plugins be compatible between v3.x and 4.x?
API update, then unsure. But best is to have manual about this :)
Too many functions, code not clear:
getQuestionAttributeData (ajax controller method)
ajaxquestionattributes (not used??)
A single point of entry to get the STRUCTURE of all attributes (general, advanced, XML, plugin), and another single point of entry to get the VALUE of all attributes.
|I will put this task in backlog, and Patrick will have a look to see if he can clean it later.|
Arg … unable to check
Starting by `uncaught exception: Object` and finally ReferenceError: LS is not defined develop:60:12
Capture d’écran du 2019-11-11 12-03-04.png (112,185 bytes)
|Hm, yeah, but those JS errors didn't affect the display of the extra attributes when I tested. But don't test now, Patric has to clean the code anyway.|
|Yes, maybe when you tested, but here : i can not load it. let me deactuvate my broken plugin maybe (and check with debug=0)|
|Fixed in Release 4.0.0-RC7+191111|
|In fact not fixed, just in prototype state.|
1. Current situation :Broken with debug>1 if there are a lack of an option : must have `$eventAttributes[$name] = array_merge($defaultQuestionAttributeValues, $attribute);` somewhere (question XML have it)
2. Must send [options][option][[value=>0][text=>"Text"]] , but seems Question user theme xml can send array directmy (think it' sthe best option
3. Value not saved (even for textarea)
For 2 :
is broken, need
array('value'=>0, 'text'=> gT("No")),
array('value'=>1, 'text'=> gT("Yes")),
But seems question user theme XML is OK with
@cdorin : someone work globally on question attribute management ?
Else : i do a quick fix to have something … (create new function to call it just before reading/save question attribute )
@DeniChenu, it's on Patrick's list, but he didn't get time to work on it yet. We have a refactor sprint first (to reduce complexity, was the goal).
You can do a quick fix if you want, if it's not too much hassle.
> to reduce complexity, was the goal
Ouf … …
|@ollehar and @p_teichmann , any thoughts on the last PR from Denis?|
|Yeah. I feel like I want to rip the entire system out with regard to question attributes and start from scratch. Design from TOP which domain objects we have and how they correspond to active record classes etc. I'm not sure what happened - the code was clear in LS3, and now complex and super-hard to follow in LS4. We need to take a step back. It's not acceptable that NEW code is more complex than OLD. If we keep going in that direction, LS will die, because no one will be able to understand it.|
|E.g., what's the difference between a question attribute in the database, and a question attribute in a question theme XMl file? Shouldn't they correspond to two different classes?|
|Looks good so far i ll test it locally again. In the old event it was allways applying the question attribute to all question types. Should there also be an option to assign it to a specific questiontype or theme?|
@ollehar : yes, but here : i just add a simple function … and use it when seems needed.
For information : without this event :
- pdfReport broken https://demo.sondages.pro/index.php/476956?lang=en# (check forum : seems used a lot)
- questionInsideSurvey : https://demo.sondages.me/217682?token=tokenTest&newtest=Y : used by my major client …
- A lot of another (Think Garbriel or @Mazi can give some other)
|It's better if it's broken than accepting we have code no one can understand. Just don't upgrade yet! I can take time next week to try to clean it|
> Just don't upgrade yet! I can take time next week to try to clean it
OK :) week or nexwt month is OK. I'm afraid of more …
> what's the difference between a question attribute in the database, and a question attribute in a question theme XMl file?
In the database : it's ONLY the value saved , in QuestionAttribute model.
XML file (or plugin) give the «definition» : utf8 or not, options list, default values etc …
> In the old event it was allways applying the question attribute to all question types. Should there also be an option to assign it to a specific questiontype or theme?
Before we read it one time at start for ALL question type. Now we read X times for each question type. Unsure of the better solution.
My opinion : we must save in a specific Cache the definitions of the QuestionAttribute.
There are other mantis related to this, becaus ein my opinion : all QuestionAttribute MUST not come from QuestionTheme …
- CSS Class : it's clearly a Survey theme related attribute
- Subquestion or Question Logic : seems related to core for me
- Timer attribute : my opinion : muts be a plugin (or another solution) but clearly not a QuestionTheme attribute.
OK, I'll create a new manual page we can use as a workboard for a new class design.
|@ollehar, you should consider if it is worth the effort to completely re-build that part now for LS4 if we have to completely re-buils lots of code for LS5 anyway!|
|@Mazi, LS5 is not going to happen soon, I sincerely hope. Yeah, we're doing some refactoring right now, but the goal is to not break anything. Reduce complexity and weird stuff, keep same functionality.|
|Fixed in Release 4.0.0-RC7+191111|
Why close this issue ?
There are NO WORKING WAY to add question attribute in 4.X
|Yeah, this should not have been closed. Guess we had a related commit and it was closed by our bot. :||
Seems saved OK :+1:
Maybe open another issue for QuestionAttribute::model()->getQuestionAttributes function difference ?
|Hey @DenisChenu, about the last issue - could you please open another ticket about it ? So that we mark this one closed since is old and we forgot about it|
|fixed in 4.4.0 rc1|
|2019-09-04 15:08||DenisChenu||New Issue|
|2019-09-04 15:08||DenisChenu||Status||new => assigned|
|2019-09-04 15:08||DenisChenu||Assigned To||=> markusfluer|
|2019-10-11 17:02||DenisChenu||Assigned To||markusfluer => cdorin|
|2019-10-16 12:29||DenisChenu||Note Added: 54061|
|2019-10-22 14:49||ollehar||Note Added: 54142|
|2019-10-22 14:51||DenisChenu||Relationship added||related to 14723|
|2019-10-22 16:04||DenisChenu||Relationship added||related to 14248|
|2019-10-23 10:41||Mazi||Note Added: 54170|
|2019-10-23 15:11||DenisChenu||Note Added: 54192|
|2019-10-23 15:12||DenisChenu||Note Edited: 54192||View Revisions|
|2019-11-06 16:16||ollehar||Note Added: 54433|
|2019-11-06 16:48||ollehar||File Added: Selection_910.png|
|2019-11-06 16:48||ollehar||Note Added: 54441|
|2019-11-06 16:57||ollehar||Note Added: 54442|
|2019-11-07 15:33||ollehar||Note Added: 54463|
|2019-11-07 15:38||ollehar||Relationship added||related to 15543|
|2019-11-07 15:47||DenisChenu||Note Added: 54464|
|2019-11-07 15:52||ollehar||Note Added: 54465|
|2019-11-07 16:05||DenisChenu||Note Added: 54467|
|2019-11-07 18:26||Mazi||Note Added: 54474|
|2019-11-08 07:44||DenisChenu||Note Added: 54479|
|2019-11-08 15:08||ollehar||Note Added: 54483|
|2019-11-08 15:10||ollehar||Note Added: 54484|
|2019-11-08 15:34||ollehar||Assigned To||cdorin => p_teichmann|
|2019-11-11 12:05||DenisChenu||File Added: Capture d’écran du 2019-11-11 12-03-04.png|
|2019-11-11 12:05||DenisChenu||Note Added: 54514|
|2019-11-11 14:07||ollehar||Note Added: 54516|
|2019-11-11 15:19||DenisChenu||Note Added: 54521|
|2019-11-12 10:24||lime_release_bot||Note Added: 54533|
|2019-11-12 10:24||lime_release_bot||Status||assigned => closed|
|2019-11-12 10:24||lime_release_bot||Resolution||open => fixed|
|2019-11-12 10:25||ollehar||Status||closed => new|
|2019-11-12 10:25||ollehar||Resolution||fixed => reopened|
|2019-11-12 10:26||ollehar||Note Added: 54534|
|2019-11-13 15:37||DenisChenu||Note Added: 54565|
|2020-01-14 10:08||cdorin||Assigned To||p_teichmann => cdorin|
|2020-01-15 07:54||DenisChenu||Note Added: 55248|
|2020-01-15 10:27||ollehar||Note Added: 55252|
|2020-01-15 10:29||DenisChenu||Note Added: 55253|
|2020-01-25 22:01||DenisChenu||Note Added: 55469|
|2020-01-25 22:07||DenisChenu||Relationship added||related to 15776|
|2020-01-28 14:53||cdorin||Note Added: 55497|
|2020-01-28 15:04||ollehar||Note Added: 55499|
|2020-01-28 15:05||ollehar||Note Added: 55500|
|2020-01-28 15:07||p_teichmann||Note Added: 55501|
|2020-01-28 15:10||DenisChenu||Note Added: 55502|
|2020-01-28 15:12||ollehar||Note Added: 55503|
|2020-01-28 15:32||DenisChenu||Note Added: 55509|
|2020-01-28 15:33||DenisChenu||Relationship added||related to 14893|
|2020-01-28 15:33||DenisChenu||Relationship added||related to 08750|
|2020-01-28 16:08||ollehar||Note Added: 55521|
|2020-01-28 16:08||ollehar||Note Edited: 55521||View Revisions|
|2020-01-28 16:11||Mazi||Note Added: 55522|
|2020-01-28 16:30||ollehar||Note Added: 55523|
|2020-01-28 16:33||ollehar||Additional Information Updated||View Revisions|
|2020-01-28 16:33||ollehar||Note Added: 55524|
|2020-02-03 14:57||lime_release_bot||Note Added: 55660|
|2020-02-03 14:57||lime_release_bot||Status||new => closed|
|2020-02-03 14:57||lime_release_bot||Resolution||reopened => fixed|
|2020-02-03 16:09||DenisChenu||Status||closed => feedback|
|2020-02-03 16:09||DenisChenu||Resolution||fixed => reopened|
|2020-02-03 16:09||DenisChenu||Note Added: 55673|
|2020-02-03 16:22||ollehar||Note Added: 55674|
|2020-02-17 12:58||cdorin||Priority||none => high|
|2020-09-10 17:19||JHoeck||Assigned To||cdorin => JHoeck|
|2020-09-15 14:01||DenisChenu||Note Added: 59811|
|2020-09-15 14:01||DenisChenu||Status||feedback => assigned|
|2020-09-15 15:01||cdorin||Note Added: 59812|
|2020-09-15 15:02||DenisChenu||Assigned To||JHoeck => p_teichmann|
|2020-09-15 15:02||DenisChenu||Status||assigned => resolved|
|2020-09-15 15:02||DenisChenu||Resolution||reopened => fixed|
|2020-09-15 15:02||DenisChenu||Fixed in Version||=> 4.3.16|
|2020-09-15 15:29||DenisChenu||Relationship added||related to 16669|
|2020-09-15 15:31||DenisChenu||Note Added: 59818|
|2020-09-19 12:32||DenisChenu||Relationship added||has duplicate 16675|
|2020-12-30 19:27||cdorin||Note Added: 61342|
|2020-12-30 19:27||cdorin||Status||resolved => closed|
|2021-02-02 15:20||DenisChenu||Relationship added||parent of 17049|
|2021-07-12 11:53||DenisChenu||Bug heat||20 => 22|
|2021-07-12 11:56||guest||Bug heat||22 => 20|
|2021-07-12 13:56||c_schmitz||Bug heat||20 => 22|
|2021-07-12 14:14||jelo||Bug heat||22 => 20|
|2021-07-12 18:54||c_schmitz||Bug heat||20 => 22|
|2021-07-12 19:11||guest||Bug heat||22 => 20|