View Issue Details

IDProjectCategoryView StatusLast Update
15224Bug reports[All Projects] Pluginspublic2019-11-13 15:37
ReporterDenisChenu Assigned Top_teichmann  
PrioritynoneSeveritymajor 
Status newResolutionreopened 
Product Version4.0.0-RC4 
Target VersionFixed in Version 
Summary15224: 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

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.0.0 github RC3 fcaab028d4
I will donate to the project if issue is resolvedNo
Browserff
Database & DB-Versionmariadb
Server OS (if known)fedora/linux
Webserver software & version (if known)nginx
PHP Versionphp7.2

Relationships

related to 14723 assignedp_teichmann Development  Global attribute or question dependance 
related to 15543 new Bug reports Document changes in plugin API for question attributes 
related to 14248 new Feature requests Allow survey theme to add (and use) question attribute 

Activities

DenisChenu

DenisChenu

2019-10-16 12:29

developer   ~54061

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.

ollehar

ollehar

2019-10-22 14:49

administrator   ~54142

My suggestion: Add the same event.

Mazi

Mazi

2019-10-23 10:41

partner   ~54170

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!

DenisChenu

DenisChenu

2019-10-23 15:11

developer   ~54192

Last edited: 2019-10-23 15:12

View 2 revisions

@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.

ollehar

ollehar

2019-11-06 16:16

administrator   ~54433

Looks like there's no "single point of entry" to fetch question attributes anymore. Sucks ass.

ollehar

ollehar

2019-11-06 16:48

administrator   ~54441

Found it. Event needs to be moved to getQuestionThemeAttributeValues in questionHelper.



Selection_910.png (12,225 bytes)
Selection_910.png (12,225 bytes)
ollehar

ollehar

2019-11-06 16:57

administrator   ~54442

Re-added the event, but needs more testing and fixing (attributes are not saved, etc).

ollehar

ollehar

2019-11-07 15:33

administrator   ~54463

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.

DenisChenu

DenisChenu

2019-11-07 15:47

developer   ~54464

No default on switch ?
Easy to fix :)

I look at it tomorrow : you can assign it to me for test :)

ollehar

ollehar

2019-11-07 15:52

administrator   ~54465

I guess switch can be sometimes Y/N, sometimes 1/0, and there's no point doing a default then.

DenisChenu

DenisChenu

2019-11-07 16:05

developer   ~54467

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 …)

Mazi

Mazi

2019-11-07 18:26

partner   ~54474

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"?

DenisChenu

DenisChenu

2019-11-08 07:44

developer   ~54479

shouldn't plugins be compatible between v3.x and 4.x?

API update, then unsure. But best is to have manual about this :)

ollehar

ollehar

2019-11-08 15:08

administrator   ~54483

Too many functions, code not clear:

getQuestionAttributesForEM
getQuestionAttributeValue
getQuestionAttributeData (ajax controller method)
getQuestionAttributes
getQuestionAttributesSettings
getQuestionAttribute
getQuestionAttributes
getQuestionThemeAttributeValues
ajaxquestionattributes (not used??)

We need:

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.

ollehar

ollehar

2019-11-08 15:10

administrator   ~54484

I will put this task in backlog, and Patrick will have a look to see if he can clean it later.

DenisChenu

DenisChenu

2019-11-11 12:05

developer   ~54514

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)
ollehar

ollehar

2019-11-11 14:07

administrator   ~54516

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.

DenisChenu

DenisChenu

2019-11-11 15:19

developer   ~54521

Yes, maybe when you tested, but here : i can not load it. let me deactuvate my broken plugin maybe (and check with debug=0)

lime_release_bot

lime_release_bot

2019-11-12 10:24

administrator   ~54533

Fixed in Release 4.0.0-RC7+191111

ollehar

ollehar

2019-11-12 10:26

administrator   ~54534

In fact not fixed, just in prototype state.

DenisChenu

DenisChenu

2019-11-13 15:37

developer   ~54565

  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 :

        $scriptAttributes['scriptActivate']['options']= array(
            0=>gT("No"),
             1=>gT("Yes"),
        );

is broken, need

        $scriptAttributes['scriptActivate']['options']= array(
          'option'=> array(
            array('value'=>0, 'text'=> gT("No")),
            array('value'=>1, 'text'=> gT("Yes")),
          ),
        );

But seems question user theme XML is OK with

            <options>
                <default>Default</default>
                <lg>Large</lg>
                <sm>Small</sm>
                <xs>Extra small</xs>
            </options>

https://github.com/LimeSurvey/LimeSurvey/blob/93f3d162d9751090f2e518c080271ab8801dcbdc/themes/question/bootstrap_buttons/survey/questions/answer/listradio/config.xml#L56-L61

Issue History

Date Modified Username Field Change
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