Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choice options are updated incorrectly after fixing the value duplication error #5915

Closed
JaneSjs opened this issue Sep 25, 2024 · 1 comment · Fixed by surveyjs/survey-library#8859
Assignees
Labels
bug user issue An issue or bug reported by users.
Milestone

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Sep 25, 2024

T19983 - Question Choices, duplicate values getting through, choices being formatted as number/string inconsistently.
https://surveyjs.answerdesk.io/internal/ticket/details/T19983


To reproduce the issue, please open https://surveyjs.io/create-free-survey, add Checkboxes, and follow the screencast.

2024-09-25_11-56-07.mp4

The resultant survey JSON contains a duplicate "1" entries.

{
  "pages": [
    {
      "name": "page1",
      "elements": [
        {
          "type": "checkbox",
          "name": "question1",
          "choices": [
            "1",
            "1",
            "3"
          ]
        }
      ]
    }
  ]
}

Expected behavior the choices have 2, 1, 3 values and their display texts are updated correspondintly.

 "choices": [
       2, 
       1,
       3
]
@JaneSjs JaneSjs added bug user issue An issue or bug reported by users. labels Sep 25, 2024
@andrewtelnov andrewtelnov self-assigned this Sep 25, 2024
@snlacks
Copy link

snlacks commented Sep 25, 2024

In the resulting JSON, one of the 1s is a string and one is a number, which might be why it's making the error message disappear.

{
  "pages": [
    {
      "name": "page1",
      "elements": [
        {
          "type": "checkbox",
          "name": "question1",
          "choices": [
            1,
            "1",
            "3"
          ]
        }
      ]
    }
  ]
}

andrewtelnov added a commit that referenced this issue Sep 27, 2024
@RomanTsukanov RomanTsukanov changed the title Choices are updated incorrectly after fixing the value duplication error Choice options are updated incorrectly after fixing the value duplication error Oct 1, 2024
@OlgaLarina OlgaLarina added this to the v1.12.4 milestone Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug user issue An issue or bug reported by users.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants