MDL-42858 Course Management: fix regression for subcategories visibility