MDL-41266 logging: Legacy reader should convert passed courseid to course in sql queries