MDL-30775 get_course_contents: remove warnings when the section is empty