Skip to content

Commit

Permalink
Merge pull request #2547 from studer-raimann/fix/27702/5-4/forum_noti…
Browse files Browse the repository at this point in the history
…fication_2

Fix/27702/5 4/forum notification 2
  • Loading branch information
mjansenDatabay authored Mar 6, 2020
2 parents 9e9dd29 + 5f133df commit 55f7ba4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Modules/Forum/classes/class.ilForumNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,21 @@ public static function getCachedNodeData($ref_id)
{
if (!array_key_exists($ref_id, self::$node_data_cache)) {
global $DIC;
self::$node_data_cache[$ref_id] = $DIC->repositoryTree()->getChildsByType($ref_id, 'frm');
$node_data = $DIC->repositoryTree()->getSubTree(
$DIC->repositoryTree()->getNodeData($ref_id),
true,
'frm'
);
$node_data = array_filter($node_data, function ($forum_node) use ($DIC, $ref_id) {
// filter out forum if a grp lies in the path (#0027702)
foreach ($DIC->repositoryTree()->getNodePath($forum_node['child'], $ref_id) as $path_node) {
if ((int) $path_node['child'] !== (int) $ref_id && $path_node['type'] === 'grp') {
return false;
}
}
return true;
});
self::$node_data_cache[$ref_id] = $node_data;
}

return self::$node_data_cache[$ref_id];
Expand Down

0 comments on commit 55f7ba4

Please sign in to comment.