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

When adding a default value for Select Input widget the JS code fails #12944

Closed
MikeAlhayek opened this issue Dec 13, 2022 · 0 comments · Fixed by #12945
Closed

When adding a default value for Select Input widget the JS code fails #12944

MikeAlhayek opened this issue Dec 13, 2022 · 0 comments · Fixed by #12945
Labels
Milestone

Comments

@MikeAlhayek
Copy link
Member

Describe the bug

When adding a default value for Select Input widget the JS code fails

To Reproduce

Steps to reproduce the behavior:

  1. In a content type where Widget can be added, add "Select" widget and then in the options editor provide the following
[
    {
        "text": "Select a state",
        "value": ""
    },
    {
        "text": "Alabama",
        "value": "AL"
    },
    {
        "text": "Alaska",
        "value": "AK"
    },
    {
        "text": "American Samoa",
        "value": "AS"
    },
    {
        "text": "Arizona",
        "value": "AZ"
    },
    {
        "text": "Arkansas",
        "value": "AR"
    },
    {
        "text": "California",
        "value": "CA"
    },
    {
        "text": "Colorado",
        "value": "CO"
    },
    {
        "text": "Connecticut",
        "value": "CT"
    },
    {
        "text": "Delaware",
        "value": "DE"
    },
    {
        "text": "District Of Columbia",
        "value": "DC"
    },
    {
        "text": "Federated States Of Micronesia",
        "value": "FM"
    },
    {
        "text": "Florida",
        "value": "FL"
    },
    {
        "text": "Georgia",
        "value": "GA"
    },
    {
        "text": "Guam Gu",
        "value": "GU"
    },
    {
        "text": "Hawaii",
        "value": "HI"
    },
    {
        "text": "Idaho",
        "value": "ID"
    },
    {
        "text": "Illinois",
        "value": "IL"
    },
    {
        "text": "Indiana",
        "value": "IN"
    },
    {
        "text": "Iowa",
        "value": "IA"
    },
    {
        "text": "Kansas",
        "value": "KS"
    },
    {
        "text": "Kentucky",
        "value": "KY"
    },
    {
        "text": "Louisiana",
        "value": "LA"
    },
    {
        "text": "Maine",
        "value": "ME"
    },
    {
        "text": "Marshall Islands",
        "value": "MH"
    },
    {
        "text": "Maryland",
        "value": "MD"
    },
    {
        "text": "Massachusetts",
        "value": "MA"
    },
    {
        "text": "Michigan",
        "value": "MI"
    },
    {
        "text": "Minnesota",
        "value": "MN"
    },
    {
        "text": "Mississippi",
        "value": "MS"
    },
    {
        "text": "Missouri",
        "value": "MO"
    },
    {
        "text": "Montana",
        "value": "MT"
    },
    {
        "text": "Nebraska",
        "value": "NE"
    },
    {
        "text": "Nevada",
        "value": "NV"
    },
    {
        "text": "New Hampshire",
        "value": "NH"
    },
    {
        "text": "New Jersey",
        "value": "NJ"
    },
    {
        "text": "New Mexico",
        "value": "NM"
    },
    {
        "text": "New York",
        "value": "NY"
    },
    {
        "text": "North Carolina",
        "value": "NC"
    },
    {
        "text": "North Dakota",
        "value": "ND"
    },
    {
        "text": "Northern Mariana Islands",
        "value": "MP"
    },
    {
        "text": "Ohio",
        "value": "OH"
    },
    {
        "text": "Oklahoma",
        "value": "OK"
    },
    {
        "text": "Oregon",
        "value": "OR"
    },
    {
        "text": "Palau",
        "value": "PW"
    },
    {
        "text": "Pennsylvania",
        "value": "PA"
    },
    {
        "text": "Puerto Rico",
        "value": "PR"
    },
    {
        "text": "Rhode Island",
        "value": "RI"
    },
    {
        "text": "South Carolina",
        "value": "SC"
    },
    {
        "text": "South Dakota",
        "value": "SD"
    },
    {
        "text": "Tennessee",
        "value": "TN"
    },
    {
        "text": "Texas",
        "value": "TX"
    },
    {
        "text": "Utah",
        "value": "UT"
    },
    {
        "text": "Vermont",
        "value": "VT"
    },
    {
        "text": "Virgin Islands",
        "value": "VI"
    },
    {
        "text": "Virginia",
        "value": "VA"
    },
    {
        "text": "Washington",
        "value": "WA"
    },
    {
        "text": "West Virginia",
        "value": "WV"
    },
    {
        "text": "Wisconsin",
        "value": "WI"
    },
    {
        "text": "Wyoming",
        "value": "WY"
    }
]
  1. Set the first options as the default value.
  2. Save
  3. When the page loaded for the second time, you'll see a JS error in the console.
@MikeAlhayek MikeAlhayek added this to the 1.6 milestone Dec 13, 2022
MikeAlhayek added a commit to MikeAlhayek/OrchardCore that referenced this issue Dec 13, 2022
MikeAlhayek added a commit that referenced this issue Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant