Skip to content

Commit 068e299

Browse files
committed
fix: Remove reference to undefined variable
Without this, the subcontext_info class in the privacy api was referring to an object that didn't exist. The function has been simplified as a result.
1 parent 218dcf6 commit 068e299

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

classes/privacy/subcontext_info.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,9 @@ trait subcontext_info {
4444
*/
4545
protected static function get_gallery_area(\stdClass $gallery) : array {
4646
$pathparts = [];
47-
if (!empty($discussion->groupname)) {
48-
$pathparts[] = get_string('groups');
49-
$pathparts[] = $discussion->groupname;
50-
}
51-
52-
$parts = [
53-
$gallery->id,
54-
$gallery->name,
55-
];
56-
57-
$galleryname = implode('-', $parts);
5847

5948
$pathparts[] = get_string('areagallery', 'mod_mediagallery');
60-
$pathparts[] = $galleryname;
49+
$pathparts[] = "{$gallery->id}-{$gallery->name}";
6150

6251
return $pathparts;
6352
}

0 commit comments

Comments
 (0)