Problem/Motivation
When an optgroup has a space in its label, clicking on its tab in improved multi select causes a JS syntax error from line 65 of improved_multi_select.js. This can be seen by using a list of nodes, with the optgroups being content types. The improved multi select works if the optgroups are the machine names (no spaces), but when using the human readable content type names (which may contain spaces) the error happens.
Proposed resolution
The click event on the optgroup uses $group.text() in a jQuery selector, like '[group!=' + $group.text() + ']' and it's not quoted. Adding double quotes on both sides of the text resolves the problem.
Remaining tasks
Review needed.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | spaces_in_optgroup_label-2139433.patch | 773 bytes | davidbarbarisi@gmail.com |
Comments
Comment #1
davidbarbarisi@gmail.com commentedComment #2
davidbarbarisi@gmail.com commentedComment #3
stupiddingo commentedI was seeing the same behavior. OptGroups with spaces were causing a full postback. This patch resolves the error.
Comment #5
dmitrii commentedThanks.
Comminted.