View Issue Details

This bug affects 2 person(s).
 14
IDProjectCategoryView StatusLast Update
18879Bug reportsSurvey editingpublic2023-06-13 15:35
ReporterTonisOrmisson Assigned Totibor.pacalat  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version6.1.x 
Summary18879: scriptEditor not shown for superAdmins
Description

Fresh install, created admin user does not see question scriptEditor, Default usersettings misconfiguration

TagsNo tags attached.
Bug heat14
Complete LimeSurvey version number (& build)6.1.3+230612
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMysql something
Server OS (if known)
Webserver software & version (if known)
PHP Version8.1

Relationships

related to 18731 closedDenisChenu Edit a question > "script" tab has disappeared 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2023-06-13 10:45

developer   ~75581

The fix is here but was closed

https://github.com/LimeSurvey/LimeSurvey/pull/3157

DenisChenu

DenisChenu

2023-06-13 10:46

developer   ~75582

ping @p_teichmann and @tibor.pacalat

Mazi

Mazi

2023-06-13 12:11

updater   ~75594

This looks like a bug to me.

People updating from 5.x to 6.x will miss this and will start asking questions right away. Please do not remove features this way. It is a helpful feature and used by many core users.

tibor.pacalat

tibor.pacalat

2023-06-13 12:21

administrator   ~75595

I reopened it, tested and merged. It was closed, because the ticket for which the fix was made https://bugs.limesurvey.org/view.php?id=18731 had different description and that particular issue was not reproducible in 6.x

TonisOrmisson

TonisOrmisson

2023-06-13 13:50

developer   ~75597

Ok I was just looking on whether to use develop or master branch to fix that. Cloned a feature branch from upstream/master and had the problem on v6 there. Possibly v5->v6 upgrade. Anyway. Glad its fixed, but the fix used will not fix users who already have the wrong user setting in the database. This also needs a migration to overwrite all wrong settings with the new one. @tibor.pacalat

<code>
public function up()
{
$this->db->createCommand()->update(
"{{settings_user}}",
[
'stg_name' => 'showScriptEdit'
],
"stg_name='showScriptEditor'"
);
}
</code>

tibor.pacalat

tibor.pacalat

2023-06-13 14:20

administrator   ~75599

Can't they switch using UI?

DenisChenu

DenisChenu

2023-06-13 15:10

developer   ~75608

@TonisOrmisson : no need migration with https://github.com/LimeSurvey/LimeSurvey/pull/3157

If not set (null) : it was set to ON.

With your update : you disable user who don't want to see script editor

TonisOrmisson

TonisOrmisson

2023-06-13 15:17

developer   ~75610

not sure if can change via ui. But with no migration you might have records in settings_user with key "showScriptEditor" which are created but never read. If you have them and don't migrate, it'll be just confusing garbage records in db. My script does not handle duplicate options yes. If there is a faulty record and a new correct one was added after that, this migration will try to create duplicate setting records. Sure you might not need to migrate, but garbage will possibly be there :)

DenisChenu

DenisChenu

2023-06-13 15:35

developer   ~75611

But with no migration you might have records in settings_user with key "showScriptEditor" which are created but never read.

Yes, right, but it don't break this feature.

not sure if can change via ui.

You can , sure at 100%

Same fix apply on 5.X since weeks now.

Issue History

Date Modified Username Field Change
2023-06-13 10:32 TonisOrmisson New Issue
2023-06-13 10:45 DenisChenu Relationship added related to 18731
2023-06-13 10:45 DenisChenu Note Added: 75581
2023-06-13 10:45 DenisChenu Bug heat 0 => 2
2023-06-13 10:46 DenisChenu Note Added: 75582
2023-06-13 12:11 guest Bug heat 2 => 8
2023-06-13 12:11 Mazi Note Added: 75594
2023-06-13 12:11 Mazi Bug heat 8 => 10
2023-06-13 12:21 tibor.pacalat Assigned To => tibor.pacalat
2023-06-13 12:21 tibor.pacalat Status new => closed
2023-06-13 12:21 tibor.pacalat Resolution open => fixed
2023-06-13 12:21 tibor.pacalat Note Added: 75595
2023-06-13 12:21 tibor.pacalat Bug heat 10 => 12
2023-06-13 13:50 TonisOrmisson Note Added: 75597
2023-06-13 13:50 TonisOrmisson Bug heat 12 => 14
2023-06-13 14:20 tibor.pacalat Note Added: 75599
2023-06-13 15:10 DenisChenu Note Added: 75608
2023-06-13 15:17 TonisOrmisson Note Added: 75610
2023-06-13 15:35 DenisChenu Note Added: 75611