Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.9.2
-
Fix Version/s: None
-
Component/s: Forum
-
Labels:None
-
Environment:N/A
-
Database:Any
-
Affected Branches:MOODLE_19_STABLE
Description
This issue appears to only affect the Q and A type of forum. I did not check or test the other types.
In Moodle 1.8.6 a teacher could view any of the student forums postings. In Moodle 1.9.2 the teacher only sees the a new question that a student submits, they no longer see the replies to those new questions.
Reproduction steps using one teacher account and two student accounts. As the teacher in a course, create a new forum as type Q and A. As student1 choose that forum and click to "Add a new question" button then create a new question. As student2, choose that forum and click on "Add a new question" then create a new question. Next, select the question that student1 created and reply to that question. Finally, as the teacher go to Participants and select student2. You will see the question that student created but you will not see the reply of student2 to the student1 new question.
Running through the same steps in 1.8.6, the teacher does see the student2 reply to the student1 question.
While I am not real good yet at reading Moodle code, the issue appears to be in the /mod/forum/lib.php file's forum_search_posts function call.
The block of code ...
if ($forum->type == 'qanda') {
if (!empty($forum->onlydiscussions)) {
$discussionsids = implode(',', $forum->onlydiscussions);
$select[] = "(d.id IN ($discussionsids) OR p.parent = 0)";
} else {
$select[] = "p.parent = 0";
}
}
is adding the parent = 0 filter for the teacher because the call in forum_get_readable_forums to build the list of forums never sets any values in $forum->onlydiscussions because the teacher has the mod/forum:viewqandawithoutposting capability. In version 1.8.6 it appears that the check for any value in the $forum->onlydiscussions is done in the outer if statement so the parent = 0 is not applied.
Thank you for reviewing this matter.
Issue Links
| This issue duplicates: | ||||
| MDL-15968 | Profile 'Forum Posts' tab does not obey mod/forum:viewqandawithoutposting |
|
|
|
I also have this problem in 1.9.2