View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
18976 | Bug reports | Survey editing | public | 2023-07-21 05:35 | 2023-10-10 04:15 |
Reporter | adamzammit | Assigned To | adamzammit | ||
Priority | none | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.1.x | ||||
Fixed in Version | 6.2.x | ||||
Summary | 18976: Saving a question with subquestions deletes default answers | ||||
Description | When a question has default answers set for subquestions, they work fine. Once the question is saved again (even if no changes made) the default answers disappear. Looking at the code here: https://github.com/LimeSurvey/LimeSurvey/blob/5a08c33c58b0e7477f840e062219c9b102b82c82/application/controllers/QuestionAdministrationController.php#L477 The subquestions are deleted and recreated on the save form submit. This creates a new qid for each of the subquestions. The associated default answers (if any exist) are not deleted and left dangling in the database. Now that the subquestions have new sids, the default answers do not link up again. | ||||
Steps To Reproduce | Steps to reproduceCreate a question that supports sub questions Expected resultDefault answers remain Actual resultDefault answers disappear | ||||
Tags | No tags attached. | ||||
Bug heat | 22 | ||||
Complete LimeSurvey version number (& build) | 6.2.x | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | Mariadb 10.5 | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 8.1 | ||||
Seems 5.X have same issue : https://github.com/LimeSurvey/LimeSurvey/blob/6afbecb3db2b252c345eac35e1d8b6aac369b04d/application/controllers/QuestionAdministrationController.php#L472 In 3.X :
Surely the way to do (maybe with another method) |
|
this is quite important to one of my clients so I have worked on a patch for this. @DenisChenu are you able to review? Now it will delete missing, add new, then update: |
|
Thanks !! Maybe try to avoid to loose forum data sent more ? Adding error in save view bu don't throw error . And try to save the maximum part we can ? User see error and can update after. Throw error according to debug >1 |
|
Needed for 5.X too ? |
|
I can confirm this is a bug. The PR provided is too complicated to apply to the code base because we have quite a large refactoring going on in the develop branch. I have created a simpler bug fix: https://github.com/LimeSurvey/LimeSurvey/pull/3357 |
|
Fix has been merged to the master branch. |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35359 |
|
thanks for fixing this @kfoster. I'll close my initial PR now. |
|
Fixed in Release 6.2.3+230821 |
|
LimeSurvey: master 4420f625 2023-08-15 23:08 K Foster Committer: GitHub Details Diff |
Fixed issue 18976 - default answers should persist with subquestions (03357) |
Affected Issues 18976 |
|
mod - application/controllers/QuestionAdministrationController.php | Diff File | ||
mod - application/models/Question.php | Diff File | ||
LimeSurvey: 5.x 0cea5e54 2023-10-04 13:15 Gabriel Jenik Committer: GitHub Details Diff |
Fixed issue 18817: Editing a question deletes default answers (#3457) Fix ported from issue 18976 - default answers should persist with subquestions Co-authored-by: Kevin Foster <kevin.foster.uk@gmail.com> |
Affected Issues 18817, 18976 |
|
mod - application/controllers/QuestionAdministrationController.php | Diff File | ||
mod - application/models/Question.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-07-21 05:35 | adamzammit | New Issue | |
2023-07-21 07:58 | DenisChenu | Issue Monitored: DenisChenu | |
2023-07-21 07:58 | DenisChenu | Bug heat | 0 => 2 |
2023-07-21 08:03 | DenisChenu | Note Added: 76206 | |
2023-07-21 08:03 | DenisChenu | Bug heat | 2 => 4 |
2023-07-24 05:57 | adamzammit | Note Added: 76238 | |
2023-07-24 05:57 | adamzammit | Bug heat | 4 => 6 |
2023-07-24 08:42 | DenisChenu | Assigned To | => DenisChenu |
2023-07-24 08:42 | DenisChenu | Status | new => ready for code review |
2023-07-24 08:52 | DenisChenu | Status | ready for code review => in code review |
2023-07-24 08:52 | DenisChenu | Note Added: 76239 | |
2023-07-24 13:04 | DenisChenu | Note Added: 76241 | |
2023-07-24 17:56 | DenisChenu | Assigned To | DenisChenu => gabrieljenik |
2023-08-08 23:38 | gabrieljenik | Assigned To | gabrieljenik => adamzammit |
2023-08-08 23:38 | gabrieljenik | Status | in code review => assigned |
2023-08-15 16:36 | kfoster | Status | assigned => confirmed |
2023-08-15 16:36 | kfoster | Complete LimeSurvey version number (& build) | 6.1.8 => 6.2.x |
2023-08-15 16:36 | kfoster | Note Added: 76604 | |
2023-08-15 16:36 | kfoster | Bug heat | 6 => 8 |
2023-08-15 21:11 | kfoster | Status | confirmed => resolved |
2023-08-15 21:11 | kfoster | Resolution | open => fixed |
2023-08-15 21:11 | kfoster | Fixed in Version | => 6.2.x |
2023-08-15 21:11 | kfoster | Note Added: 76608 | |
2023-08-15 21:28 | Changeset attached | => LimeSurvey master 4420f625 | |
2023-08-15 21:28 | guest | Note Added: 76609 | |
2023-08-15 21:28 | guest | Bug heat | 8 => 10 |
2023-08-16 01:10 | adamzammit | Note Added: 76610 | |
2023-08-21 09:51 | LimeBot | Note Added: 76653 | |
2023-08-21 09:51 | LimeBot | Status | resolved => closed |
2023-08-21 09:51 | LimeBot | Bug heat | 10 => 12 |
2023-09-13 16:27 | DenisChenu | Relationship added | has duplicate 18817 |
2023-09-13 16:27 | DenisChenu | Bug heat | 12 => 20 |
2023-09-13 17:58 | gabrieljenik | Bug heat | 20 => 22 |
2023-10-04 11:32 | Changeset attached | => LimeSurvey 5.x 0cea5e54 | |
2023-10-10 04:15 | mfavetti | Relationship added | related to 19160 |