Fix roomsearch when 'periods' disabled.
Fix compatibility with Moodle 2.7 - replace add_to_log with new events handling