Set my paragraph to use the Select2 formatter and it had some JS errors. Resolved it by checking for the value's existence before attempting to use it. I don't know if this is the best approach, but it resolved the error for me and the Select2 widget works again. Patch below.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | after.png | 1.56 KB | deaom |
| #3 | before.png | 2.08 KB | deaom |
| #2 | 3096293-select2-edit-form-widget-breaks-on-paragraphs.patch | 671 bytes | PaulDinelle |
Comments
Comment #2
PaulDinelle commentedFirst patch to resolve the error.
Comment #3
deaom commentedI also came across this issue, which is breaking the widget display. Tested the patch and the issue is gone.


The errors in the console and the display is back to normal.
Comment #4
dercheffeI can confirm same error on node edit forms after update to select2 version 1.5 even not using paragraphs. The error occurs on a normal node edit form.
The good news are that the provided patch applied to version 1.5 fixing the error also. Thank you for patching :)
IMO this is a major issue because it's breaking the module and makes it (nearly) useless. Please make a new release.
Comment #5
arnaldopThis patch (#3) works for me!
Thanks!
Comment #6
gbirch commentedWorks for me too.
Comment #7
chr.fritschOpened a PR and added a test for that https://github.com/thunder/select2/pull/78
Comment #8
chr.fritschComment #10
chr.fritschAll the tests were green. PR merged. Thank you everyone