MDL-38631 Fixed faulty add_category call, introduced in 758103
MDL-38631 link categories in My courses only when needed