Got a context with several node types selected, not using $context_links == bam, pages were doing menu_get_item for node/add 10+ items for a unused variable.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Grayside’s picture

Rerolled patch.

malc0mn’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I can confirm this works as intended and indeed saves a humongous amount of node/add/% calls for each and every page load. The biggest problem for me personally was that this also happens for anonymous users who do not even have access to those pages!

I tried to improve this patch by adding an access check around this part:

  if (variable_get('context_display_context_links', TRUE) && ($context_links = context_links())) {
    $vars['context_links'] = theme('links', $context_links);
  }

but as this is all ctools (a module wich I've always failed to understand properly) I left it at that. My goal was to check if the user has access to the context admin links by means of a simple user_access('some permission here').

Bottom line again: this patch works as designed and fixes my problem as I do not need those links anyway.

mlc.

paulocs’s picture

As 6.x-3.x version is no longer supported, please reopen the issue if you still need it in the supported versions (7.x-3.x and 8.x-4.x).

paulocs’s picture

Status: Reviewed & tested by the community » Fixed
paulocs’s picture

Status: Fixed » Closed (won't fix)