View Issue Details

This bug affects 2 person(s).
 16
IDProjectCategoryView StatusLast Update
18731Bug reportsQuestion editorpublic2023-06-13 12:27
Reporterpasglop Assigned ToDenisChenu  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version5.6.x 
Summary18731: Edit a question > "script" tab has disappeared
Description

The "script" tab does not appear by default whatever the user rights.

If you go to the top right corner of my login > My account > My personal settings, you will find the option "Show script field:" set to "Yes" but it is not taken into account in the question editing tabs.
After "Save and close": it's good! The "script" tab is back.

As these are old accounts, and there was a lot of LS maj, I started from a new account to test in good conditions.

=> "Steps To Reproduce"

Steps To Reproduce

After the creation of the account (tb lime_settings_user) : cf create_cpt.png
Everything seems to be fine (if the stg_name "showScriptEditor" is the one corresponding to the "script" tab) but when creating a question via this new user, the tab is still missing.

Menu "My login > My account > My personal settings > Save and close" (tb lime_settings_user) : we notice the addition of "ShowScriptEditor
saveoptionuser.png

Back to the edition of my question : it's perfect !
The right stg_name for the "script" tab would be "showScriptEdit" which is not registered by default in the table (unlike "showScriptEditor" which must be something else at the moment....).

Translated with www.DeepL.com/Translator (free version)

TagsNo tags attached.
Attached Files
create_cpt.png (50,753 bytes)   
create_cpt.png (50,753 bytes)   
saveoptionuser.png (89,288 bytes)   
saveoptionuser.png (89,288 bytes)   
Bug heat16
Complete LimeSurvey version number (& build)Version 5.6.11+230320
I will donate to the project if issue is resolvedNo
BrowserAll
Database type & version10.5.18-MariaDB-0+deb11u1-log - Debian 11
Server OS (if known)Debian 11
Webserver software & version (if known)Apache/2.4.56 (Debian)
PHP VersionVersion de PHP : 8.0.28

Relationships

related to 18879 closedtibor.pacalat scriptEditor not shown for superAdmins 

Users monitoring this issue

pasglop

Activities

DenisChenu

DenisChenu

2023-04-06 11:30

developer   ~74410

Confirm with a new user

DenisChenu

DenisChenu

2023-05-19 15:49

developer   ~75115

@pasglop maybe you can test ?

5.X : https://github.com/LimeSurvey/LimeSurvey/pull/3156
master/6.X : https://github.com/LimeSurvey/LimeSurvey/pull/3157

DenisChenu

DenisChenu

2023-05-19 15:51

developer   ~75116

Step to reproduce

  1. Create a new user
  2. Gve him superadmin right
  3. Log in as this user :
  4. check question edit : no script
  5. Check user pref : show script are at Yes : DON'T SAVE

Set as this commit

  1. check question edit : script tab appear
tibor.pacalat

tibor.pacalat

2023-06-02 13:18

administrator   ~75384

@DenisChenu Hmm, when I test this on master, I am following your instructions, but for me "Show script field" is "No" (point 5 in your instruction) so I don't see the issue here to be honest.

DenisChenu

DenisChenu

2023-06-02 13:33

developer   ~75385

@DenisChenu Hmm, when I test this on master, I am following your instructions, but for me "Show script field" is "No" (point 5 in your instruction) so I don't see the issue here to be honest.

With a new user ?
Did you test on 5 too ?

Maybe in 6 if it's not set it was set to default.
BUT : it's not the attended behavior according to this line : https://github.com/LimeSurvey/LimeSurvey/blob/6181e6c416c375425901ae7204d2b234e170cf8f/application/core/LsDefaultDataSets.php#L1843
['stg_name' => 'showScriptEditor', 'stg_value' => '1'],

tibor.pacalat

tibor.pacalat

2023-06-02 16:28

administrator   ~75395

The issue exists in 5.x and is fixed with the PR provided.
However I can not reproduce the issue in master, since the value is set to "No" for a fresh user, which leads me to believe that no fix is necessary for master.

DenisChenu

DenisChenu

2023-06-02 16:29

developer   ~75396

Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=34765

DenisChenu

DenisChenu

2023-06-02 17:56

developer   ~75403

However I can not reproduce the issue in master, since the value is set to "No" for a fresh user, which leads me to believe that no fix is necessary for master.

It's not the ttended behavior : DefaultDataSet use ['stg_name' => 'showScriptEditor', 'stg_value' => '1'],

ping @ptelu maybe ?

p_teichmann

p_teichmann

2023-06-03 10:53

administrator   ~75406

Last edited: 2023-06-03 10:59

  1. It seems the defaultset is only used for creating new users, it is not used for creating dummy users and also not set by default for the superadmin.
  2. The naming used to determine the display of the script edtior is called "showScriptEdit" everywhere except in the defaultdataset where it is called "showScriptEditor"
  3. the personalsettings are displayed as "yes"(1) when the string doesn't exist yet in the user settings
DenisChenu

DenisChenu

2023-06-03 13:58

developer   ~75407

the personalsettings are displayed as "yes"(1) when the string doesn't exist yet in the user settings

Yes for 5.X, no for 6.X

Then it don't seems to be an issue in 6.

With SettingsUser::getUserSettingValue('showScriptEdit', App()->user->id, null, null, 1); i clearly set 1 as default value.

LimeBot

LimeBot

2023-06-05 11:26

administrator   ~75414

Fixed in Release 5.6.25+230605

DenisChenu

DenisChenu

2023-06-06 15:31

developer   ~75434

@p_teichmann : Need to remove the showScriptEditor in DefaultDataSet

Don't put invalid value in DefaultDataSet please …

DenisChenu

DenisChenu

2023-06-13 09:34

developer   ~75571

Last edited: 2023-06-13 09:34

Can explain this line ['stg_name' => 'showScriptEditor', 'stg_value' => '1'], ?

https://github.com/LimeSurvey/LimeSurvey/blob/de071e01d299b41cc79cc4067f06760ef351da31/application/core/LsDefaultDataSets.php#L1843

DenisChenu

DenisChenu

2023-06-13 12:27

developer   ~75596

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=34805

Related Changesets

LimeSurvey: 5.x c12dd424

2023-06-02 18:29

DenisChenu

Committer: GitHub


Details Diff
Fixed issue 18731: Edit a question "script" tab has disappeared (#3156)

* Fixed issue 18731: Edit a question : "script" tab has disappeared
Dev: add default possibility and fix user creation

* Dev!: remove uneeded option
Affected Issues
18731
mod - application/controllers/QuestionAdministrationController.php Diff File
mod - application/core/LsDefaultDataSets.php Diff File
mod - application/models/SettingsUser.php Diff File

LimeSurvey: master 7462a2ad

2023-06-13 14:18

DenisChenu

Committer: GitHub


Details Diff
Fixed issue 18731: Edit a question "script" tab has disappeared (#3157)

Dev: use default in question editor
Affected Issues
18731
mod - application/controllers/QuestionAdministrationController.php Diff File
mod - application/core/LsDefaultDataSets.php Diff File
mod - application/models/SettingsUser.php Diff File

Issue History

Date Modified Username Field Change
2023-04-06 11:09 pasglop New Issue
2023-04-06 11:09 pasglop File Added: create_cpt.png
2023-04-06 11:09 pasglop File Added: saveoptionuser.png
2023-04-06 11:11 pasglop Issue Monitored: pasglop
2023-04-06 11:11 pasglop Bug heat 0 => 2
2023-04-06 11:30 DenisChenu Assigned To => DenisChenu
2023-04-06 11:30 DenisChenu Status new => confirmed
2023-04-06 11:30 DenisChenu Note Added: 74410
2023-04-06 11:30 DenisChenu Bug heat 2 => 4
2023-04-25 14:27 guest Bug heat 4 => 10
2023-05-19 11:45 DenisChenu Assigned To DenisChenu => gabrieljenik
2023-05-19 11:45 DenisChenu Status confirmed => ready for code review
2023-05-19 15:41 gabrieljenik Assigned To gabrieljenik => DenisChenu
2023-05-19 15:41 gabrieljenik Status ready for code review => ready for testing
2023-05-19 15:49 DenisChenu Note Added: 75115
2023-05-19 15:49 DenisChenu Assigned To DenisChenu => tibor.pacalat
2023-05-19 15:51 DenisChenu Note Added: 75116
2023-06-02 13:18 tibor.pacalat Note Added: 75384
2023-06-02 13:18 tibor.pacalat File Added: Screenshot 2023-06-02 at 13.16.53.png
2023-06-02 13:18 tibor.pacalat Bug heat 10 => 12
2023-06-02 13:33 DenisChenu Note Added: 75385
2023-06-02 16:28 tibor.pacalat Note Added: 75395
2023-06-02 16:29 DenisChenu Changeset attached => LimeSurvey 5.x c12dd424
2023-06-02 16:29 DenisChenu Note Added: 75396
2023-06-02 16:29 DenisChenu Assigned To tibor.pacalat => DenisChenu
2023-06-02 16:29 DenisChenu Resolution open => fixed
2023-06-02 17:56 DenisChenu Note Added: 75403
2023-06-03 10:53 p_teichmann Note Added: 75406
2023-06-03 10:53 p_teichmann Bug heat 12 => 14
2023-06-03 10:59 p_teichmann Note Edited: 75406
2023-06-03 13:58 DenisChenu Note Added: 75407
2023-06-05 11:26 LimeBot Note Added: 75414
2023-06-05 11:26 LimeBot Status ready for testing => closed
2023-06-05 11:26 LimeBot Bug heat 14 => 16
2023-06-06 15:31 DenisChenu Note Added: 75434
2023-06-13 09:34 DenisChenu Note Added: 75571
2023-06-13 09:34 DenisChenu Note Edited: 75571
2023-06-13 10:45 DenisChenu Relationship added related to 18879
2023-06-13 12:27 DenisChenu Changeset attached => LimeSurvey master 7462a2ad
2023-06-13 12:27 DenisChenu Note Added: 75596