Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
contextual.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Feb 2012 at 01:09 UTC
Updated:
4 Jan 2014 at 01:39 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
swentel commentedNice find, could reproduce this as well. It's menu_contextual_links() which is responsible which keeps a static registry of parent_paths which didn't generate links and returns an empty array the third time, although you have permissions for the node.
Patch attached makes an exception on the node parent_path. Now, this will make the patch at least work, but I'm not sure if this the right way to fix this, however, we know at least where it goes wrong.
Comment #3
martijn houtman commented@Swentel: I don't think this check is the way to go. I was looking into this as well, it happens with wildcard links, such as 'whatever/%'. The wildcard will be replaced by anything, yet the caching stores the wildcard, not what it is replaced with.
The following works for me:
(sorry for not creating a patch, I am unable to right now)
(edit: formatting fixed)
Comment #4
swentel commentedYeah, I really didn't like that solution as well :)
Trying your solution (untested, but we'll let the testbot decide). If it turns green, we'll need to get Sun in here.
Comment #5
sunThank you!
This edge-case was/is known already, as I wasn't sure how to reasonably support it without breaking performance badly. However, this tweak looks acceptable to me.
Should end in TestCase, not Test.
Let's add
at the very top of this test case, and afterwards, add 'node' to the list of modules to install.
Lastly, add this before creating the user:
Comment #6
swentel commentednew patch
Comment #7
martijn houtman commentedThanks guys! Any chance this will be back-ported to 7.x?
Comment #8
Niklas Fiekas commentedYeah, I think it should be.
Comment #10
sunContextualDynamicContextTestCase would actually sound more appropriate.
You likely need to add 'access content' here to fix the test failures.
Just:
"Tests accessible links after inaccessible links on dynamic context."
(possibly also adjust the test method name)
Comment #11
Niklas Fiekas commentedReroll with your suggestion from here and IRC.
Edit: The interdiff is wrong.
Comment #12
sunThe phpDoc on the class and the test method looks somewhat reversed to me :)
Aside from that, this looks good to me.
(Note that another test-only patch wouldn't hurt.)
Comment #13
Niklas Fiekas commentedHehe. That explains my confusion with the doxygen ;)
Rerolled.
Comment #14
Niklas Fiekas commentedForgot the
files[] = contextual.testin the test only patch above. So that will likely pass, because the test won't even run.Comment #16
sunThank you!
Extra points and huge credits for introducing the first test for Contextual module! :)
Comment #17
dries commentedCommitted to 8.x. Thanks. Moving to 7.x.
Comment #18
Niklas Fiekas commentedBackport.
Comment #20
Niklas Fiekas commentedComment #21
xjmBackport looks good. (Tagging for posterity.) One comment is a little weird, but not important enough since it went into 8.x already. I smell a novice issue. :)
Comment #22
webchickOooh. Yay for contextual.module tests!
Committed and pushed to 7.x. Thanks!
Comment #23
xjmOpened followup issue: #1462062: Clarify comment and use gender-neutral language in contextual.test.