View Issue Details

This bug affects 2 person(s).
 18
IDProjectCategoryView StatusLast Update
19108Bug reportsQuestion editorpublic2023-10-23 20:08
Reporteresadergin Assigned Toollehar  
PrioritynoneSeveritycrash 
Status assignedResolutionopen 
Product Version6.2.x 
Summary19108: Error: Subquestion codes should be unique. Cannot save the subquestions even their codes are unique.
Description

Hello everyone,
When I try to create an array question, I keep receiving an error say that "subquestion codes should be unique" and the system does not allow me to save and close. I typed the code names totally different and unique. From now on, I cannot go further and sent 2 mails to help desk. Nobody backed to me. This is a bug of the system it seems.
Thanks in advance.

Steps To Reproduce

Steps to reproduce

(Replace this text with detailed step-by-step instructions on how to reproduce the issue)

Expected result

(Write here what you expected to happen)

Actual result

(Write here what happened instead)

TagsNo tags attached.
Attached Files
1.jpg (167,352 bytes)
2.jpg (97,922 bytes)   
2.jpg (97,922 bytes)   
Bug heat18
Complete LimeSurvey version number (& build)6.2.7
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPersonal data
Server OS (if known)
Webserver software & version (if known)
PHP VersionLimeSurvey Cloud Version 6.2.7

Relationships

related to 19088 closedtibor.pacalat Question Array(Text) codes must be unique (but they are) 
related to 19160 confirmedkfoster Unable to save subquestions 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2023-09-22 09:26

developer   ~77245

Last edited: 2023-09-22 09:29

Confirm the issue with Array text BUT strangely it disappear … after some time …

I try to create a clean way to reproduce (arg , no way … but i see it … doing exactly same action : still no way …)

Before fixing : can you just save (and closeà without any action ? And try again ?

esadergin

esadergin

2023-09-22 10:07

reporter   ~77247

I tried so many things but they made no sense. Sometimes it saves and closes, sometimes it does not. I created a new survey and tried to create Array, however it acts the same. Once, i only added questions without any change, it didnt save and close. Actually, in the question page, i save it and it saves. Then I can preview the question and it is ok. However, when I click on "save and close" button, it errors. As a result of this, I cannot step further.

DenisChenu

DenisChenu

2023-09-22 10:14

developer   ~77248

OK, seems related to Close button

See screencast

Please try with never use the Close action button.

Peek 22-09-2023 10-13.gif (1,198,246 bytes)
DenisChenu

DenisChenu

2023-09-22 10:20

developer   ~77249

Save + Save and close : broke
Save and do something : seem OK
Save and close : seems OK

Not related to scale_id

@kfoster : maybe related to https://github.com/LimeSurvey/LimeSurvey/pull/3357 ?

Peek 22-09-2023 10-16.gif (1,590,643 bytes)
ollehar

ollehar

2023-09-22 10:48

administrator   ~77250

Whoever fixes this, please write an automated test to make sure it doesn't happen again.

esadergin

esadergin

2023-09-22 10:48

reporter   ~77251

Yes it is what you created in screencast.
Thank you.
I tried and never used close button. It works for now. Hope i will never click on close button unintentionally.

ollehar

ollehar

2023-09-22 10:49

administrator   ~77252

Save + Save and close : broke

What's the result returned from server in the network tab? Also check console.

DenisChenu

DenisChenu

2023-09-22 10:50

developer   ~77253

What's the result returned from server in the network tab? Also check console.

I don't check exactly … i confirm and find way to reproduce.

ollehar

ollehar

2023-09-22 11:30

administrator   ~77255

kk. did you check on latest master too? Kevin did a fix yesterday, I think.

ollehar

ollehar

2023-09-22 11:36

administrator   ~77257

Please update to the latest version and check if the bug can still be reproduced. Thank you.

esadergin

esadergin

2023-09-22 11:43

reporter   ~77258

I have just checked and it still gives the same error. After adding sub-questions with unique names, and click "save" and then if we click on "save and close", it gives error. But if we do not click on "save and close" it does not give error. I stick to Denis' way for now. Thanks.

DenisChenu

DenisChenu

2023-09-22 14:26

developer   ~77266

kk. did you check on latest master too? Kevin did a fix yesterday, I think.

I check on GIT version …

Yes , i think it's related to https://github.com/LimeSurvey/LimeSurvey/pull/3357
It's the reason i ping https://bugs.limesurvey.org/view.php?id=19108#c77249

DenisChenu

DenisChenu

2023-09-22 14:26

developer   ~77267

PS : I ALWAYS check on last GIT version …

guest

guest

2023-09-23 14:56

viewer   ~77294

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

kfoster

kfoster

2023-09-23 15:03

developer   ~77295

I have just pushed a fix to master.

The problem is when a subquestion code is moved by typing the codes instead and dragging the codes. This caused a duplication error because the code attempts update a subquestion with a code that sill exists in the database. To get around this I modified the logic so that we check for a matching code/scale-id combination first and if it exists we update.

Can @esadergin or @DenisChenu test against master and confirm the issue is resolved before we close this report?

Thanks

DenisChenu

DenisChenu

2023-09-25 10:20

developer   ~77296

@kfoster : then, for example if :

  • subquestion code A width default answer
  • subquestion code B widthout default answer

User update and put B on subquestion code A and C on subquestion B : default answer are lost … and we have the issue 19108

If you look at screencast : there are no «typing» seems the save action don't put the code at good place

kfoster

kfoster

2023-09-25 16:50

developer   ~77314

If you look at the screen cast, the same sub question codes are being used for both the X and Y scale. So in this case its not a bug the error message is correct.

Regardless, this bug report has helped us identify and fix a related issue.

@esadergin can you confirm you dont have any problem when you use different code on both the X and Y scale.

DenisChenu

DenisChenu

2023-09-26 08:33

developer   ~77320

If you look at the screen cast, the same sub question codes are being used for both the X and Y scale. So in this case its not a bug the error message is correct.

  1. NO : it's allowed since years to have same code for X and Y scale
  2. It's happen for simplearray : see 2nd screencast https://bugs.limesurvey.org/view.php?id=19108#c77249

And again : the new fix introduce issue for Default answer moving from one question to another one …

kfoster

kfoster

2023-09-26 08:55

developer   ~77322

@DenisChenu thanks for testing again and pointing this out. I will try to push a fix this morning. Hopefully this one is final.

DenisChenu

DenisChenu

2023-09-26 13:04

developer   ~77326

I didn't test again, i just show the issue are not related to your fix : it's a HTML issue in my opinion.

I make a screencast with the nezw GIT version where you LOOSE subquestion, this commit seems broken https://github.com/LimeSurvey/LimeSurvey/commit/dc083bd9e3280fbe58da885f157c6e48707cae2f

Peek 26-09-2023 13-01.gif (460,280 bytes)
guest

guest

2023-09-26 13:20

viewer   ~77329

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

kfoster

kfoster

2023-09-26 13:28

developer   ~77330

A new fix has been pushed. Please test again. Thank you.

BIFI_research

BIFI_research

2023-10-23 16:31

reporter   ~77877

Hi, I just want to report the same or a very similar problem.

I am using LimeSurvey Cloud Version 5.6.41

Simple array question with SQs that I added via "Quick add" + "Replace".

It happens when I press "Save" and also when I press "Save and close"

array_bug.png (102,118 bytes)
BIFI_research

BIFI_research

2023-10-23 17:05

reporter   ~77880

Hi,
I am not sure if I should open a new entry or if it fits in here:

Exactly the same thing not only happens with array questions, but with Multiple Choice questions, too.

Related Changesets

LimeSurvey: master dc083bd9

2023-09-23 16:54

Kevin Foster


Details Diff
fixed issue 19108 - move subquestion code by typing instead of dragging Affected Issues
19108
mod - application/controllers/QuestionAdministrationController.php Diff File

LimeSurvey: master d20c9a91

2023-09-26 15:20

Kevin Foster


Details Diff
fixed issue 19108 - avoid duplicate code error with temp code prefix Affected Issues
19108
mod - application/controllers/QuestionAdministrationController.php Diff File

Issue History

Date Modified Username Field Change
2023-09-22 08:46 esadergin New Issue
2023-09-22 08:46 esadergin File Added: 1.jpg
2023-09-22 08:46 esadergin File Added: 2.jpg
2023-09-22 09:26 DenisChenu Note Added: 77245
2023-09-22 09:26 DenisChenu Bug heat 0 => 2
2023-09-22 09:29 DenisChenu Note Edited: 77245
2023-09-22 10:07 esadergin Note Added: 77247
2023-09-22 10:07 esadergin Bug heat 2 => 4
2023-09-22 10:14 DenisChenu Note Added: 77248
2023-09-22 10:14 DenisChenu File Added: Peek 22-09-2023 10-13.gif
2023-09-22 10:20 DenisChenu Note Added: 77249
2023-09-22 10:20 DenisChenu File Added: Peek 22-09-2023 10-16.gif
2023-09-22 10:48 ollehar Note Added: 77250
2023-09-22 10:48 ollehar Bug heat 4 => 6
2023-09-22 10:48 esadergin Note Added: 77251
2023-09-22 10:49 ollehar Note Added: 77252
2023-09-22 10:50 DenisChenu Note Added: 77253
2023-09-22 10:50 DenisChenu Status new => confirmed
2023-09-22 11:30 ollehar Note Added: 77255
2023-09-22 11:36 c_schmitz Bug heat 6 => 8
2023-09-22 11:36 ollehar Assigned To => ollehar
2023-09-22 11:36 ollehar Status confirmed => feedback
2023-09-22 11:36 ollehar Note Added: 77257
2023-09-22 11:36 c_schmitz Bug heat 8 => 6
2023-09-22 11:43 esadergin Note Added: 77258
2023-09-22 11:43 esadergin Status feedback => assigned
2023-09-22 14:26 DenisChenu Note Added: 77266
2023-09-22 14:26 DenisChenu Note Added: 77267
2023-09-22 15:09 gabrieljenik Relationship added related to 19088
2023-09-23 14:56 Changeset attached => LimeSurvey master dc083bd9
2023-09-23 14:56 guest Note Added: 77294
2023-09-23 14:56 guest Bug heat 6 => 8
2023-09-23 15:03 kfoster Note Added: 77295
2023-09-23 15:03 kfoster Bug heat 8 => 10
2023-09-25 10:20 DenisChenu Note Added: 77296
2023-09-25 16:50 kfoster Note Added: 77314
2023-09-26 08:33 DenisChenu Note Added: 77320
2023-09-26 08:55 kfoster Note Added: 77322
2023-09-26 13:04 DenisChenu Note Added: 77326
2023-09-26 13:04 DenisChenu File Added: Peek 26-09-2023 13-01.gif
2023-09-26 13:20 Changeset attached => LimeSurvey master d20c9a91
2023-09-26 13:20 guest Note Added: 77329
2023-09-26 13:28 kfoster Note Added: 77330
2023-10-23 16:31 BIFI_research Note Added: 77877
2023-10-23 16:31 BIFI_research File Added: array_bug.png
2023-10-23 16:31 BIFI_research Bug heat 10 => 12
2023-10-23 17:05 BIFI_research Note Added: 77880
2023-10-23 20:08 mfavetti Relationship added related to 19160
2023-10-29 21:08 guest Bug heat 12 => 18