View Issue Details

This bug affects 2 person(s).
 24
IDProjectCategoryView StatusLast Update
19160Bug reportsSurvey editingpublic2023-11-23 11:07
Reportermfavetti Assigned Tokfoster  
PriorityhighSeverityblock 
Status confirmedResolutionreopened 
Product Version5.6.x 
Summary19160: Unable to save subquestions
Description

In fixing the default answers being overridden when saving subquestions for 5.x and 6.x branches (18817 and 18976, respectively) a regression was introduced that prevented questions with subquestion being created. This was fixed for 6.x in 8da618d91e3406b447b09c5ee3106c2a035e06d6 (19152).

However, the above fix also created a regression in 5.x that prevents questions with subquestions from being saved with a message that subquestion codes must be unique. This regression was not fixed and the issue persists.

I think this will take a combination of changes from commits 8da618d91e3406b447b09c5ee3106c2a035e06d6 and d5b0bec9921e3a3c9ca764774e9440893dcb94d5 in the 6.x branch to fix the 5.x branch.

In 6.x, the subquestion code validation was moved out of the model and into a separate function. This is where the fix for the regression was applied in 6.x. In 5.x the validation is still done in the model and because the subquestions are not deleted anymore before saving the new ones, the new ones fail the unique test.

@kfoster

Recommend users stay on 5.6.39 until fixed. (I think this is worse than default answers being overridden)

TagsNo tags attached.
Bug heat24
Complete LimeSurvey version number (& build)5.6
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmariadb 10.6
Server OS (if known)
Webserver software & version (if known)
PHP Version8.0.32

Relationships

related to 18817 closedkfoster Editing a question deletes default answers 
related to 18976 closedadamzammit Saving a question with subquestions deletes default answers 
related to 19152 closedc_schmitz ERROR 500 when creat multiple choice question or multiple short text 
related to 19088 closedtibor.pacalat Question Array(Text) codes must be unique (but they are) 
has duplicate 19265 closedmfavetti input on demand: cannot update in place subquestions unless changing subq. code 
related to 19108 assignedollehar Error: Subquestion codes should be unique. Cannot save the subquestions even their codes are unique. 

Users monitoring this issue

mfavetti, ritapas

Activities

guest

guest

2023-10-12 15:53

viewer   ~77677

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

LimeBot

LimeBot

2023-10-16 08:55

administrator   ~77726

Fixed in Release 5.6.41+231017

mfavetti

mfavetti

2023-10-17 09:32

developer   ~77732

Last edited: 2023-10-17 09:34

problem persists in 5.6.41

create survey
create multipe choice question
add subquestions
save question
change subquestions
save question

behavior: error! subquestion codes must be unique (but they are unique)
expected: successful save

i don't know if i should open a new issue or modify this one

@kfoster

mfavetti

mfavetti

2023-10-17 09:47

developer   ~77733

QuestionAdministrationController.php L:2803 the new subquestion gets saved here, but the existing ones are not deleted until L:2825 the model checks if the subquestion is unique in rules Question.php L:176, so the save fails because the model says the subquestion is not unique

guest

guest

2023-10-17 15:42

viewer   ~77744

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

guest

guest

2023-10-17 15:42

viewer   ~77745

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

ollehar

ollehar

2023-10-20 14:50

administrator   ~77808

As mentioned in chat, also test with quick add + replace.

mfavetti

mfavetti

2023-10-26 21:01

developer   ~78066

testing on 5.6.42

can change sq codes and sq text
can add/remove sqs

quick add/replace still errors

mfavetti

mfavetti

2023-11-22 22:49

developer   ~78658

another user reported this problem today in 19265

Related Changesets

LimeSurvey: 5.x abcc4222

2023-10-12 17:43

K Foster

Committer: GitHub


Details Diff
Fixed issue 19160 - subquestion save, scale id code (#3532)

* Fixed issue 19160 - subquestion save, code can be duplicate between scales

* dev: refactor QuestionAdministrationController::storeSubquestions
Affected Issues
19160
mod - application/controllers/QuestionAdministrationController.php Diff File

LimeSurvey: 5.x 132e6f61

2023-10-17 17:39

K Foster

Committer: GitHub


Details Diff
Bug/19160 v5 subquestion save (03546)

* 'Fixed issue 19160 - subquestion save, code can be duplicate between scales

* dev: refactor QuestionAdministrationController::storeSubquestions

* Fixed issue 19160 - delete removed subquestions
Affected Issues
19160
mod - application/controllers/QuestionAdministrationController.php Diff File

LimeSurvey: 5.x 132e6f61

2023-10-17 17:39

K Foster

Committer: GitHub


Details Diff
Bug/19160 v5 subquestion save (03546)

* 'Fixed issue 19160 - subquestion save, code can be duplicate between scales

* dev: refactor QuestionAdministrationController::storeSubquestions

* Fixed issue 19160 - delete removed subquestions
Affected Issues
19160
mod - application/controllers/QuestionAdministrationController.php Diff File

Issue History

Date Modified Username Field Change
2023-10-10 04:15 mfavetti New Issue
2023-10-10 04:15 mfavetti Relationship added related to 18817
2023-10-10 04:15 mfavetti Relationship added related to 18976
2023-10-10 04:16 mfavetti Relationship added related to 19152
2023-10-10 04:17 mfavetti Description Updated
2023-10-10 04:18 mfavetti Description Updated
2023-10-10 04:20 mfavetti Description Updated
2023-10-10 04:21 mfavetti Issue Monitored: mfavetti
2023-10-10 04:21 mfavetti Bug heat 0 => 2
2023-10-10 04:23 mfavetti Description Updated
2023-10-10 04:24 mfavetti Description Updated
2023-10-10 04:24 mfavetti Priority none => high
2023-10-10 14:30 DenisChenu Assigned To => kfoster
2023-10-10 14:30 DenisChenu Status new => assigned
2023-10-10 14:31 DenisChenu Status assigned => feedback
2023-10-12 15:53 Changeset attached => LimeSurvey 5.x abcc4222
2023-10-12 15:53 guest Note Added: 77677
2023-10-12 15:53 guest Bug heat 2 => 4
2023-10-16 08:55 LimeBot Note Added: 77726
2023-10-16 08:55 LimeBot Status feedback => closed
2023-10-16 08:55 LimeBot Resolution open => fixed
2023-10-16 08:55 LimeBot Bug heat 4 => 6
2023-10-17 09:32 mfavetti Note Added: 77732
2023-10-17 09:32 mfavetti Bug heat 6 => 8
2023-10-17 09:32 mfavetti Status closed => confirmed
2023-10-17 09:32 mfavetti Resolution fixed => reopened
2023-10-17 09:33 mfavetti Note Edited: 77732
2023-10-17 09:33 mfavetti Note Edited: 77732
2023-10-17 09:33 mfavetti Note Edited: 77732
2023-10-17 09:34 mfavetti Note Edited: 77732
2023-10-17 09:47 mfavetti Note Added: 77733
2023-10-17 15:42 Changeset attached => LimeSurvey 5.x 132e6f61
2023-10-17 15:42 Changeset attached => LimeSurvey 5.x 132e6f61
2023-10-17 15:42 guest Note Added: 77744
2023-10-17 15:42 guest Note Added: 77745
2023-10-20 14:50 ollehar Note Added: 77808
2023-10-20 14:50 ollehar Bug heat 8 => 10
2023-10-23 20:08 mfavetti Relationship added related to 19108
2023-10-23 20:10 mfavetti Relationship added related to 19088
2023-10-26 21:01 mfavetti Note Added: 78066
2023-11-22 22:47 mfavetti Relationship added has duplicate 19265
2023-11-22 22:47 mfavetti Bug heat 10 => 16
2023-11-22 22:49 mfavetti Note Added: 78658
2023-11-23 10:28 guest Bug heat 16 => 22
2023-11-23 11:07 ritapas Issue Monitored: ritapas
2023-11-23 11:07 ritapas Bug heat 22 => 24