Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/27702/5 4/forum notification 2 #2547

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ($path_node['child'] !== $ref_id && $path_node['type'] == 'grp') {
mjansenDatabay marked this conversation as resolved.
Show resolved Hide resolved
return false;
mjansenDatabay marked this conversation as resolved.
Show resolved Hide resolved
}
}
return true;
mjansenDatabay marked this conversation as resolved.
Show resolved Hide resolved
});
self::$node_data_cache[$ref_id] = $node_data;
}

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