Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | context.links_toggle-1670328-1.patch | 1.28 KB | Grayside |
context_links.patch | 1.28 KB | hefox | |
Comments
Comment #1
Grayside CreditAttribution: Grayside commentedRerolled patch.
Comment #2
malc0mn CreditAttribution: malc0mn commentedI 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:
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.
Comment #3
paulocsAs 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).
Comment #4
paulocsComment #5
paulocs