View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
16599 | Bug reports | Question editor | public | 2020-08-17 17:41 | 2020-12-14 11:19 |
Reporter | fabianlehner | Assigned To | cdorin | ||
Priority | none | Severity | partial_block | ||
Status | closed | Resolution | no change required | ||
Product Version | 4.3.10 | ||||
Summary | 16599: Cannot update Answers (Type O) – Answer::checkUniqueness bug | ||||
Description | When trying to save from the question editor for a type O question, even if I haven't changed anything, I get an LSJsonException saying "Answer codes must be unique by question". My research found that QuestionEditorController::storeAnswerOptions calls Answer::setAttributes with the bare string values from the request, which supposedly aren't correctly casted (aid, qid, scale_id should be int). Answer::checkUniqueness checks these against the (same, but int) values from the database, therefore fails to recognize that it's the same Answer object, and raises the above message. Casting aid, qid and scale_id before setAttributes solves the problem. | ||||
Steps To Reproduce | see above | ||||
Additional Information | PR follows | ||||
Tags | duplicate | ||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 4.3.10 (master) | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | Postgres 11 | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 7.4.9 | ||||
duplicate 16313 |
|
Hey @fabianlehner , have you tried the fix provided in : https://bugs.limesurvey.org/view.php?id=16313 ? |
|
No feedback provided |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2020-08-17 17:41 | fabianlehner | New Issue | |
2020-08-17 17:54 | fabianlehner | Note Added: 59490 | |
2020-08-17 17:54 | fabianlehner | Tag Attached: duplicate | |
2020-10-22 16:52 | cdorin | Note Added: 60369 | |
2020-10-22 16:52 | cdorin | Status | new => feedback |
2020-12-14 11:19 | cdorin | Assigned To | => cdorin |
2020-12-14 11:19 | cdorin | Status | feedback => closed |
2020-12-14 11:19 | cdorin | Resolution | open => no change required |
2020-12-14 11:19 | cdorin | Note Added: 60941 |