Automatically closed - issue fixed for 2 weeks with no activity.
The implementation of preprocess_menu in the social_course module is unnecessary and can be removed. Additionally it can be quite slow.
The function goes through all menu links and checks if the url is accessible by the current user. This is already done using the access layer in Drupal, and should also never be done in a preprocess function.
I tested this function to see if it actually removed any links and the result was 0. For authenticated users, on a production site with many links, it processed 89 links and removed 0. For a site manager it processed 433 links and removed 0.
Clear your caches, open a page with different roles and dump the result of the if statement in the code below.
if (!$item['url']->access($account)) {
// Dump result here.
continue;
}
else {
$accessible_items[$key] = $item;
}
Just get rid of it, it is meaningless and only adds processing time.
Fixed
5.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed - issue fixed for 2 weeks with no activity.