View Issue Details

This issue affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
20473Bug reportsSurvey editingpublic2026-03-26 16:33
Reporterblazej.kania@goddit.io Assigned To 
PrioritynoneSeveritypartial_block 
Status newResolutionopen 
Product Version6.16.x 
Summary20473: Could not save the subquestion after survey duplication
Description

Few weeks ago I created new survey which is just copy of old one. After the survey activation I wasn't able to edit question with subquestions. All I received from the server was:

{
"success": false,
"message": "

Could not save subquestion

",
"redirectTo": "/index.php/surveyAdministration/view?surveyid={sid}",
"error": "Could not save subquestion",
"detailedErrors": []
}

I fixed it manually. The issue was, subquestions in new survey inherited gid of old survey. I run this sql query to fix DB:

UPDATE lime_questions AS child
SET gid = parent.gid
FROM lime_questions AS parent
WHERE child.parent_qid = parent.qid
AND child.sid ={sid}
AND child.gid != parent.gid;

In future, I don't want to manually edit the db rows, so can you fix that bug in next version?

Steps To Reproduce

Steps to reproduce

  1. Create new survey
  2. Add question with subquestions
  3. Copy the survey
  4. Activate the new survey
  5. Just click Save

Expected result

I can edit the question, db relations are set up correctly

Actual result

Subquestions in new survey inherited gid of old survey

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)6.16.5
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPostgresql 17.6
Server OS (if known)linux
Webserver software & version (if known)
PHP Version8.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

tibor.pacalat

tibor.pacalat

2026-03-26 14:29

administrator   ~84529

Last edited: 2026-03-26 14:33

You are not allowed to edit subquestion codes when the survey is active.
If you want to edit them, you need to deactivate the survey and then edit them.
Maybe I didn't understand correctly what is your issue, but it looks fine to me on production.
Can you send me the lss file which you are copying?

blazej.kania@goddit.io

blazej.kania@goddit.io

2026-03-26 15:20

reporter   ~84530

You are right, but when I just click "Save" in top right corner I see the toast with error message. The problem is when I want to edit the main question. The field isn't disabled so I guess I can edit it, even when survey is active

blazej.kania@goddit.io

blazej.kania@goddit.io

2026-03-26 15:21

reporter   ~84531

When survey is deactivated, the error still occurs

DenisChenu

DenisChenu

2026-03-26 16:00

developer   ~84532

@tibor.pacalat it seems the issue is

The issue was, sub-questions in new survey inherited gid of old survey

The gid of sub-questions must always be gid of the parent question. It can be in Data consistency check

tibor.pacalat

tibor.pacalat

2026-03-26 16:02

administrator   ~84533

@DenisChenu can you reproduce? I don't see the gid being copied literally.

DenisChenu

DenisChenu

2026-03-26 16:20

developer   ~84534

Can not reproduce on 6.16.13 using quick copy

DenisChenu

DenisChenu

2026-03-26 16:21

developer   ~84535

@blazej.kania@goddit.io question type ?

For us to be able to investigate this issue please attach a 2 question sample survey demonstrating the issue, either as .lss file (survey structure) or (even better) as .lsa file (survey archive).

blazej.kania@goddit.io

blazej.kania@goddit.io

2026-03-26 16:33

reporter   ~84536

@DenisChenu I'll try to reproduce this issue again and send evidence

Issue History

Date Modified Username Field Change
2026-03-26 14:06 blazej.kania@goddit.io New Issue
2026-03-26 14:29 tibor.pacalat Note Added: 84529
2026-03-26 14:29 tibor.pacalat File Added: Screenshot 2026-03-26 at 14.27.43.png
2026-03-26 14:29 tibor.pacalat Bug heat 0 => 2
2026-03-26 14:33 tibor.pacalat Note Edited: 84529
2026-03-26 15:20 blazej.kania@goddit.io Note Added: 84530
2026-03-26 15:20 blazej.kania@goddit.io File Added: Screenshot 2026-03-26 at 15.20.00.png
2026-03-26 15:20 blazej.kania@goddit.io Bug heat 2 => 4
2026-03-26 15:21 blazej.kania@goddit.io Note Added: 84531
2026-03-26 16:00 DenisChenu Note Added: 84532
2026-03-26 16:00 DenisChenu Bug heat 4 => 6
2026-03-26 16:02 tibor.pacalat Note Added: 84533
2026-03-26 16:20 DenisChenu Note Added: 84534
2026-03-26 16:20 DenisChenu File Added: Capture d’écran du 2026-03-26 16-19-19.png
2026-03-26 16:21 DenisChenu Note Added: 84535
2026-03-26 16:33 blazej.kania@goddit.io Note Added: 84536