MDL-30085 Added missing MOODLE_INTERNAL and MUST_EXISTS check