View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
20185Bug reportsSurvey editingpublic2025-08-07 14:42
ReporterTonisOrmisson Assigned Totibor.pacalat  
PrioritynoneSeverityminor 
Status resolvedResolutionfixed 
Product Version6.6.x 
Summary20185: Answer Options Not Deleted When Changing Question Type to Multiple Choice
Description

When changing a question type from single-choice questions (like L - List Radio) to M (Multiple Choice), LimeSurvey fails to clean up the old answer options from the database,
causing orphaned records and data inconsistency.

Steps To Reproduce
  1. Create a new survey
  2. Add a question with type L (List Radio)
  3. Add several answer options (e.g., "Option A", "Option B", "Option C")
  4. Save the question
  5. Change the question type to M (Multiple Choice)
  6. Save the question
  7. Check database:
    • SELECT * FROM lime_answers WHERE qid = [question_id]
    • SELECT al.* FROM lime_answer_l10ns al JOIN lime_answers a ON al.aid = a.aid WHERE a.qid = [question_id]
TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)6.13.0
I will donate to the project if issue is resolvedNo
Browser
Database type & versionn/a
Server OS (if known)
Webserver software & version (if known)
PHP Versionn/a

Users monitoring this issue

There are no users monitoring this issue.

Activities

tibor.pacalat

tibor.pacalat

2025-07-23 15:11

administrator   ~83140

I think this should be handled in BE.

TonisOrmisson

TonisOrmisson

2025-07-23 21:45

developer   ~83142

I was thinking maybe the QuestionType should have a property $answers or $hasAnswers or something similar to $subquestions there?

gabrieljenik

gabrieljenik

2025-07-30 15:50

manager   ~83158

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

guest

guest

2025-08-07 14:42

viewer   ~83188

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

Related Changesets

LimeSurvey: master fdf9f346

2025-08-07 14:42

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 20185: Answer Options Not Deleted When Changing Question Type to Multiple Choice (04384)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
20185
mod - application/models/Question.php Diff File

Issue History

Date Modified Username Field Change
2025-07-22 10:42 TonisOrmisson New Issue
2025-07-22 13:55 TonisOrmisson Product Version => 6.6.x
2025-07-23 15:11 tibor.pacalat Assigned To => gabrieljenik
2025-07-23 15:11 tibor.pacalat Status new => assigned
2025-07-23 15:11 tibor.pacalat Note Added: 83140
2025-07-23 15:11 tibor.pacalat Bug heat 0 => 2
2025-07-23 21:45 TonisOrmisson Note Added: 83142
2025-07-23 21:45 TonisOrmisson Bug heat 2 => 4
2025-07-30 15:50 gabrieljenik Assigned To gabrieljenik => DenisChenu
2025-07-30 15:50 gabrieljenik Status assigned => ready for code review
2025-07-30 15:50 gabrieljenik Note Added: 83158
2025-07-30 15:50 gabrieljenik Bug heat 4 => 6
2025-07-30 16:13 DenisChenu Assigned To DenisChenu => tibor.pacalat
2025-07-30 16:13 DenisChenu Status ready for code review => ready for testing
2025-08-07 14:42 Changeset attached => LimeSurvey master fdf9f346
2025-08-07 14:42 guest Note Added: 83188
2025-08-07 14:42 guest Bug heat 6 => 8
2025-08-07 14:42 tibor.pacalat Status ready for testing => resolved
2025-08-07 14:42 tibor.pacalat Resolution open => fixed