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

Fix hierarchy js error for special characters in prefLabels #1227

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

schlawiner
Copy link
Contributor

related to #1221.

The trouble was that in one place when building the tree, the getLabel function wasn't used to create the html for notation and preflabel. The getLabel function unescapes special characters in labels and also adds a .tree-label class to the label span, which is later filtered for when sorting the tree in naturalCompare - if it doesn't exist, the variable it depends on isn't filled and the whole thing breaks down.

Lines 221 and 222 are removed because a) the same thing is done in getLabel, and 2) because it didn't escape special chars and doesn't add the .tree-label class that getLabel does.

@sonarcloud
Copy link

sonarcloud bot commented Oct 21, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma osma self-assigned this Nov 2, 2021
@osma osma added the bug label Nov 3, 2021
@osma osma added this to the 2.13 milestone Nov 3, 2021
@osma
Copy link
Member

osma commented Nov 3, 2021

Thanks a lot @schlawiner - this is perfect. I tested it with the UNESCO Thesaurus and this indeed fixes the problems with the hierarchy display of top level concepts.

There may still be additional cases that are broken, where a similar getLabel() call needs to be added, but those can be handled in separate PRs.

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 this pull request may close these issues.

2 participants