moodleou / moodle-mod_forumng

ForumNG forum module for Moodle
19 stars 20 forks source link

Moodle 3.0 - can't reply to posts #65

Closed aspark21 closed 8 years ago

aspark21 commented 8 years ago

Moodle: 3.0 latest stable ForumNG: latest master branch DB: MariaDB 10.0

This is thrown when replying to a post, it does not occur when posting a new post. The trace isn't very informative as to where the issue might lie - e.g. incompatibility with another plugin.

Any ideas?

Coding error detected, it must be fixed by a programmer: User is not available at this point.

More information about this error

Debug info: Error code: codingerror Stack trace: line 294 of /mod/forumng/mod_forumng_post.php: coding_exception thrown line 379 of /mod/forumng/mod_forumng_post.php: call to mod_forumng_post->get_user() line 1322 of /mod/forumng/mod_forumng_post.php: call to mod_forumng_post->get_formatted_message() line 1009 of /mod/forumng/mod_forumng_discussion.php: call to mod_forumng_post->search_update() line 1088 of /mod/forumng/mod_forumng_post.php: call to mod_forumng_discussion->create_reply() line 558 of /mod/forumng/editpost.php: call to mod_forumng_post->reply()

jason-platts commented 8 years ago

This bit of code (get_user) only gets called on reply if you have trust text feature active.

As we don't, I expect there is a bug that we have never spotted...

Yep, looking at the code it is not going to work - discussion create_reply() does not sent user info to new mod_forumng_post() in the same way as usually sent via query when loading the post (needs to be u_id property).

aspark21 commented 8 years ago

Hi Jason, Yes that would explain it. We are rolling out Panopto this week on our sites & the trust text feature had to be enabled for that. I thought it was odd for it to surface only now since we've been on 3.0 for a while.

Since our Panopto rollout is time sensitive for us - need to go live on the 17th June - do you see this as a quick fix which you might get a chance to look at?

Can look at funding some development time to address this if need be.

jason-platts commented 8 years ago

The fix looks pretty easy to implement and test, so I should be able to do it this week.

We are well overdue updating github repo with our latest code so I'll get the fix done and then we'll do that asap.

aspark21 commented 8 years ago

Fantastic. Thanks Jason!

Life saver!

jason-platts commented 8 years ago

A fix is now in master branch... 3ea334b3471886865b30b9959fa5ccc793dafe60 (Moodle 3 branch is also now up - this fix is only in master)