Skip to content

Issue #3329004 "Remove redundant access check in preprocess_menu hook"

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.

This closes #3329004.

Merge request reports