Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

MDL-21265 wiki - fix problem for students not able to see entries in …

…other groups until own entry is created by teacher. Backported from 19_STABLE
  • Loading branch information...
1 parent 1154b26 commit fb2fe3c35541583052b5bb0a12e0dab842adf98a @stronk7 stronk7 committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 mod/wiki/lib.php
8 mod/wiki/lib.php
@@ -916,11 +916,13 @@ function wiki_can_add_entry(&$wiki, &$user, &$course, $userid=0, $groupid=0) {
else if ($groupid == 0) {
return ($mygroupid != 0 and wiki_is_teacher($wiki));
- /// If there is a group mode, non-editing teachers with an assigned group, can only create wikis
- /// in their group. Non-editing teachers with no assigned group and editing teachers can create any wiki.
+ /// If requesting a group, must be an editing teacher, a non-editing teacher with no assigned group,
+ /// or a non-editing teacher requesting their group. or a student in group, but wiki is empty.
else {
return (wiki_is_teacheredit($wiki) or
- (wiki_is_teacher($wiki) and ($mygroupid == 0 or @in_array($groupid, $mygroupid))));
+ (wiki_is_teacher($wiki) and ($mygroupid == 0 or @in_array($groupid, $mygroupid))) or
+ (wiki_is_student($wiki, $user->id) and @in_array($groupid, $mygroupid))
+ );

0 comments on commit fb2fe3c

Please sign in to comment.
Something went wrong with that request. Please try again.