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, '&lt;').replace(/>/g, '&gt;') +'</li>');
}
else {
    $('#improvedselect-'+ improvedselect_id +' .improvedselect_all', context).append('<li so="'+ $(this).attr('value') +'">'+ 
        $(this).text().replace(/</g, '&lt;').replace(/>/g, '&gt;') +'</li>');
}

Comments

adanielyan’s picture

I meant adding
.replace(/</g, '&lt;').replace(/>/g, '&gt;')
Just forgot to wrap it by code tags

wolffereast’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
StatusFileSize
new1.08 KB

Upping this to the 2.x dev branch as it is still an issue.
Rolled a patch containing the changes above for ease of application.

wolffereast’s picture

I 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

  • wolffereast authored b82a7dd on 7.x-2.x
    Issue #1797352: Taxonomy term parent selecting bug.
    
dmitrii’s picture

Status: Needs review » Fixed

#3 committed. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.