Fix extraneous arrow showing on home page if Meta 2 is empty string #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The codebase always assumes you want exactly two levels of tagging hierarchy (Meta 1, Meta 2).
But at UoE, we only use Meta 1 for SCQF and leave Meta 2 empty. This in effect creates a meta pair with Meta 2 left as an empty string, i.e. (SCQF, "").
When the home page (sorted by SCQF) tries to render collapsible arrows, it assumed the hiearchy to exist, causing visual bugs like below. This PR patches that code to check if Meta 2 is an empty string, and prevent collapsing if so.
The way we do it is not a perfect solution and more of a workaround, but unless we also rework the tagging system (to be arbitrary depth, or single-level deep) it's the best we can do.