If the improved_multi_select is used on taxonomy term editing page the option is not visible in parent selection box. However is assigned as a parent of a term by default, even if another terms is selected as a parent, and there is no way to unselect it (because it is not visible).
Adding .replace(//g, '>') to the string in improved_multi_select.js fixes the problem:
if ($(this).attr('selected')) {
$('#improvedselect-'+ improvedselect_id +' .improvedselect_sel', context).append('<li so="'+ $(this).attr('value') +'">'+
$(this).text().replace(/</g, '<').replace(/>/g, '>') +'</li>');
}
else {
$('#improvedselect-'+ improvedselect_id +' .improvedselect_all', context).append('<li so="'+ $(this).attr('value') +'">'+
$(this).text().replace(/</g, '<').replace(/>/g, '>') +'</li>');
}
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | improved-multi-select-taxonomy-select-bug-1797352-3.patch | 1013 bytes | wolffereast |
| #2 | improved-multi-select-taxonomy-select-bug-1797352-2.patch | 1.08 KB | wolffereast |
Comments
Comment #1
adanielyan commentedI meant adding
.replace(/</g, '<').replace(/>/g, '>')Just forgot to wrap it by code tags
Comment #2
wolffereast commentedUpping this to the 2.x dev branch as it is still an issue.
Rolled a patch containing the changes above for ease of application.
Comment #3
wolffereast commentedI realized that the issue was with the .text() ignoring what it assumed was html int he options. Changing this to .html() simplifies the code and should catch any other encoding issues. If anyone has any situations in which you dont want to keep all of the html in the option please point them out
Comment #5
dmitrii commented#3 committed. Thanks.