Moving get $cm outside of the 'forum_enabletimedposts' condition as it is needed even if this isn't set.
Moving get $cm outside of the 'forum_enabletimedposts' condition as it is needed even if this isn't set.

dilawar/moodle