Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
14185Bug reportsTheme editorpublic2019-04-30 09:12
Reportertpartner Assigned Todominikvitt 
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.15.x 
Target Version3.15.xFixed in Version4.0.0dev 
Summary14185: Need a clean way to hide custom question theme attributes
Description

Currently, the only way I can see to hide unnecessary question attributes in a custom question theme is to set the <inputtype> to null in the config.xml file (see attached). This effectively disables the attribute setting but does not totally hide it from the survey author.

Is there a way to completely remove the attribute setting from the edit-question view?

Sample config file and theme attached.

TagsNo tags attached.
Attached Files
sliderWithControls.zip (52,629 bytes)
config.xml (9,922 bytes)
capture-3.png (29,455 bytes)   
capture-3.png (29,455 bytes)   
Bug heat8
Complete LimeSurvey version number (& build)3.15.1
I will donate to the project if issue is resolvedNo
BrowserN/A
Database type & versionmysqlnd 5.0.12-dev
Server OS (if known)Windows 10
Webserver software & version (if known)Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.9
PHP Version7.1.9

Relationships

related to 14190 new [question template] Some core attribute disable existing template 

Activities

DenisChenu

DenisChenu

2018-10-26 10:53

developer   ~49446

Last edited: 2018-10-26 10:54

You think it's better to hide it in css ? Or totally wipe out in html ?

What param : new param 'visible'=> (true|false) (true by default) ?

If visible == false : don't display it.

Leave readonly like currently : if visible is false, readonly is false : you can add script (in future) to update it. But visible=>false,readonly=>true : didn't display + didn't allow update.

tpartner

tpartner

2018-10-26 11:00

partner   ~49448

I think it would be safer to completely remove it from the HTML with a new parameter.

If you want it displayed but not editable (readonly), you can do something like I have done for "Use slider layout".

DenisChenu

DenisChenu

2018-10-26 11:09

developer   ~49449

«If you want it displayed but not editable (readonly), » just add readonly => true attribute

It's done for this and really clean :) since https://github.com/LimeSurvey/LimeSurvey/commit/a875677a03f18b4cc505ef51379deaa29d2e2340#diff-51f80c6491f513287823eb97b46c89f2 it's cleaner in view
And since https://github.com/LimeSurvey/LimeSurvey/commit/de422484a4fddc0fd9603809965ec4950e0ffec3#diff-51f80c6491f513287823eb97b46c89f2 it disable update (and remove) in PHP too

tpartner

tpartner

2018-10-26 11:31

partner   ~49450

Okay, I knew about <readonly_when_active>, but not simply <readonly>. I'll try that for "Use slider layout".

DenisChenu

DenisChenu

2018-10-27 15:56

developer   ~49461

Last edited: 2018-10-27 15:57

OK, testing currently some code about replace existing attribute …

There are a big issue : https://github.com/LimeSurvey/LimeSurvey/pull/1159 with included updated config.xml : ajax relaod didn't show location settings.
In fact : there are more issue : because current template are "auto_complete", then https://github.com/LimeSurvey/LimeSurvey/blob/378db43d7c58e4c9050cce6e91594d7331c7f1c7/application/controllers/admin/questions.php#L1680 unset it …

I see to fix this

        &lt;!-- Hide map attribute -->
        &lt;attribute>
            &lt;name>location_city&lt;/name>
            &lt;visible>0&lt;/visible>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_state&lt;/name>
            &lt;visible>0&lt;/visible>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_postal&lt;/name>
            &lt;visible>0&lt;/visible>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_country&lt;/name>
            &lt;visible>0&lt;/visible>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>statistics_showmap&lt;/name>
            &lt;visible>0&lt;/visible>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_mapservice&lt;/name>
            &lt;visible>0&lt;/visible>
            &lt;readonly>1&lt;/readonly>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_mapwidth&lt;/name>
            &lt;visible>0&lt;/visible>
            &lt;readonly>1&lt;/readonly>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_mapheight&lt;/name>
            &lt;visible>0&lt;/visible>
            &lt;readonly>1&lt;/readonly>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_nodefaultfromip&lt;/name>
            &lt;visible>0&lt;/visible>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_defaultcoordinates&lt;/name>
            &lt;visible>0&lt;/visible>
        &lt;/attribute>
        &lt;attribute>
            &lt;name>location_mapzoom&lt;/name>
            &lt;visible>0&lt;/visible>
        &lt;/attribute>
config-2.xml (3,532 bytes)
DenisChenu

DenisChenu

2018-10-28 14:30

developer   ~49462

Fix committed to master_visibleOrNot_attribute branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=28409

DenisChenu

DenisChenu

2018-10-30 15:10

developer   ~49493

@dominikvitt : can you confirm it's fixed in develop ?

Question : seems you version remove existing attribute from DB : did this attended behaviour ?

DenisChenu

DenisChenu

2018-10-30 15:42

developer   ~49496

@tpartner : did you try with <types></type> ?

I test : it don't work when set template, but it‘s reaaly work after saving it

And this fix this issue too : https://bugs.limesurvey.org/view.php?id=14190

dominikvitt

dominikvitt

2018-11-02 15:41

developer   ~49519

@DenisChenu: yes, it is fixed in develop.
It is intended behaviour.
I don't think you need to save unused attribute into database.

tpartner

tpartner

2018-11-03 07:26

partner   ~49525

@dominikvitt, how is it fixed? Can you please point to some documentation?

DenisChenu

DenisChenu

2018-11-03 11:42

developer   ~49527

@tpartner : did you try with <types></types> ? I test it (with autocomplete and location attributes): seems OK.

@dominikvitt : i think your current fix is more a kind of hack

c_schmitz

c_schmitz

2019-04-30 09:12

administrator   ~51662

Fixed in Version 3.1.7.3

Related Changesets

LimeSurvey: master_visibleOrNot_attribute 3c62f955

2018-10-27 12:21:19

DenisChenu

Details Diff
New feature 14185: Need a clean way to hide custom question theme attributes
Dev: still a little issue, explain in pull request
Affected Issues
14185
mod - application/models/QuestionAttribute.php Diff File
mod - application/views/admin/survey/Question/advanced_settings_view.php Diff File

Issue History

Date Modified Username Field Change
2018-10-26 10:17 tpartner New Issue
2018-10-26 10:17 tpartner File Added: sliderWithControls.zip
2018-10-26 10:17 tpartner File Added: config.xml
2018-10-26 10:17 tpartner File Added: capture-3.png
2018-10-26 10:26 tpartner Description Updated
2018-10-26 10:53 DenisChenu Note Added: 49446
2018-10-26 10:53 DenisChenu Assigned To => DenisChenu
2018-10-26 10:53 DenisChenu Status new => assigned
2018-10-26 10:53 DenisChenu Note Edited: 49446
2018-10-26 10:54 DenisChenu Note Edited: 49446
2018-10-26 11:00 tpartner Note Added: 49448
2018-10-26 11:09 DenisChenu Note Added: 49449
2018-10-26 11:31 tpartner Note Added: 49450
2018-10-27 15:56 DenisChenu File Added: config-2.xml
2018-10-27 15:56 DenisChenu Note Added: 49461
2018-10-27 15:57 DenisChenu Note Edited: 49461
2018-10-28 14:30 DenisChenu Changeset attached => LimeSurvey master_visibleOrNot_attribute 3c62f955
2018-10-28 14:30 DenisChenu Note Added: 49462
2018-10-28 14:30 DenisChenu Resolution open => fixed
2018-10-28 14:41 DenisChenu Relationship added related to 14190
2018-10-30 15:09 DenisChenu Assigned To DenisChenu => dominikvitt
2018-10-30 15:10 DenisChenu Note Added: 49493
2018-10-30 15:42 DenisChenu Note Added: 49496
2018-11-02 15:41 dominikvitt Note Added: 49519
2018-11-03 00:38 DenisChenu Status assigned => resolved
2018-11-03 00:38 DenisChenu Fixed in Version => 4.0.0dev
2018-11-03 07:26 tpartner Note Added: 49525
2018-11-03 11:42 DenisChenu Note Added: 49527
2019-04-30 09:12 c_schmitz Note Added: 51662
2019-04-30 09:12 c_schmitz Status resolved => closed