drachels/moodle-mod_hotquestion

New instance not being set at the needed moment for calendar Open event

drachels opened this issue · 2 comments

Missed the fact that the instance ($hotquestion->id) was not being created at the correct place in the hotquestion_add_instance function. It was actually being set in the return, which was after the hotquestion_update_calendar function was being called. No problem for an already created HotQuestion activity, but when creating a new HotQuestion activity, it was causing a debug message for the missing id number.

Rewrote the hotquestion_add_instance function so that the $hotquestion->id is created before the hotquestion_update_calendar function is called. Code is now in master branch. Calendar Open event now works as expected when creating a new HotQuestion activity in a course.

Fix included in new 3.5.3+ release.