Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
contextual.module
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
19 Dec 2009 at 16:08 UTC
Updated:
3 Jan 2014 at 01:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Bojhan commentedSo using path_is_admin I determain if its on admin/* and disable contextual links. Excluding Dashboard which applies the contextual links pattern to its module's interface. With that in mind, perhaps this should be more flexible to allow other modules to do such a thing?
Comment #2
Bojhan commentedMr.bot
Comment #3
dave reidYeah I'm thinking there should be a way for a module to be able to disable form its own code, and dashboard would be an implementation of this. Something like:
But this still isn't good since we still have to do a check in the contextual.module for path_is_admin().
:/
Comment #4
chx commentedhttp://webchick.net/patch-reviewers-are-not-clairvoyant
Comment #5
Bojhan commentedCouldn't screenshot my mouse, so painted one in.
Before patch
After patch
Comment #6
dave reidLittle more context.
Comment #7
Bojhan commentedchx pointed out this is a wrong approach, we have to remove it only from the help text block. Obviously I was wrong, correcting the title.
Comment #8
dave reidThis is what we want then, disabling contextual links on the system_help block.
Comment #9
dave reidIt's only possible to do this here and not in hook_block_view_alter() contrary to the example there since the contextual links are not available yet in the $data array. Let me know if there is any better place or what could be improved since I don't see any better solution than #8 right now.
Comment #10
sunWhy shouldn't I be able to configure the help block contextually?
I also think that a limitation to != admin* is wrong.
What do we really want?
Comment #11
Bojhan commentedWe want to hide contextual links on help block - as the patch outlines.
Why? Because the use case of configuring help text blocks is very very slim, and shouldn't have contextual links - and it draws attention unnecessarily.
Comment #12
Bojhan commentedAfter discussing with tha_sun in IRC, he referd that the ideal solution would be "that "stack" of contextual links would support an #access property or similar" but that related to an issue "dynamic argument loading" - which to me seems somewhat heavy to make a counter part of this issue.
Given that we should either go with #8 or go for a CSS approach. Would love commiters feedback on this.
Comment #13
sunAt the very least, we need to update the inline comment if we go with this patch... It's relatively clear why we skip system_main (from a technical perspective), but system_help is a purely "assumptions"-driven exception.
This review is powered by Dreditor.
Comment #14
dries commentedI'm OK with this patch because I agree that it is slightly annoying while on the administration pages -- I think it is reasonable to assume that less than 1% of all Drupal users would want to edit this block inline. I can certainly relate to why we are considering this patch. That said, I'd think that most editors wouldn't have the block administration permission. Happy to commit this when marked RTBC though.
Comment #18
mrfelton commentedPatch in #8 seems to work for me. Removes the contextual links from the help block.
Comment #20
aspilicious commentedGonna retest this for sure, and i'm gonna test this now.
I'll report back in a few minutes!
Comment #21
amc commented#8: 663956-block-help-nocontextual-D7.patch queued for re-testing.
Comment #22
sunStill needs work, see #13.
Comment #23
sunAttached patch looks a bit more Drupalish.
At first, I added the hook implementation to Help module, but then had to realize that System module provides the Help block. (That's odd, should be cleaned up in D8.)
The missing alter hooks for the renderable arrays generated by Block module make this issue much major, at minimum.
Comment #24
sunComment #25
Bojhan commentedSince hooks are also missing, bug?
Comment #26
sunBlock API - what a mess. hook_block_view_alter() + co badly need to be cleaned up. We are currently caching block alterations.
Back to #8 with better docs. Let's move the addition of hook_block_region_alter() to a separate issue.
Comment #27
sunThis is actually the almost same patch that was about to be committed previously already - just the docs have been expanded to explain WTF is happening, like I requested back in #13.
Comment #28
Bojhan commentedAwesome :) Do you have an issue for the other thing we can link?
Comment #29
sunNo, I'm starting to needlessly fight with core committers to get the most simple bug fixes in, and I don't really care about Block API, so I won't even start to think about creating any issues for it. ;)
Comment #30
dries commentedMake D7, not war. ;-)
Committed to CVS. Thanks.
Comment #31
moshe weitzman commentedcontextual links recently became a proper part of the $page array so there are other ways to fix this now. but this way is fine too.