MDL-41029 core: Fix wrong guessing of course id in event base