Closed (fixed)
Project:
Context OG
Version:
6.x-2.0-beta1
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2010 at 20:02 UTC
Updated:
16 Aug 2010 at 18:00 UTC
I created a context that simply checks the "OG Group Type" to determine if a node is posted in a group. The behavior I'm seeing isn't quite what I expected.
When viewing the group home page.... not seeing the blocks I enabled.
When viewing a view page (node/[group nid]/view_page_path)... I do see the blocks enabled.
When viewing a node posted to the group... not seeing the blocks I enabled.
When viewing group edit, broadcast, track tabs... I do see the blocks enabled.
I have the context_devel block displaying on every page... and my context is showing up under context_ui in all cases. I do not have any other contexts using the same attribute.
Comments
Comment #1
mstef commentedI'd call this a dupe of #854280: Context trigger doesn't work when a Panel overrides a Group node
Maybe we should just start with my 2.x branch and make it better?
Comment #2
caschbre commentedI'm not using panels and haven't changed the group home page. Very odd.
Which 2.x branch is yours? I'm using 6.x-2.0-beta1, should I switch to the dev?
Comment #3
caschbre commentedI switched to the latest 6.x-2.0-dev and still have the same issue.
Comment #4
marcp commentedThere's probably a timing issue with regards to when the context gets set. If you guys could work together and try out my suggestion in comment 1 at #854280: Context trigger doesn't work when a Panel overrides a Group node that would be helpful.
Comment #5
caschbre commentedI think I figured it out...
The context_og_context_page_condition was working for view pages and the other tabs off of the group node. (the two working conditions in my original post).
I added a hook_nodeapi and performed the same logic as context_og_context_page_condition and was able to get it working on the other two conditions in my original post.
Note: This code was simply a copy/paste to see if using hook_nodeapi worked... we'd probably want to make another function that contains this logic that both hooks can call.
Comment #6
marcp commentedYeah, this is definitely about what I was hoping for.
Ideally we'd be able to put this code in
context_og_init()and get everything working -- want to give that a try instead of inhook_nodeapi()?Comment #7
caschbre commentedI'll see if I can get to it tonight.
Comment #8
caschbre commentedcontext_og_init did not appear to work.
It appears that the function og_get_group_context is not able to return anything in hook_init. Might be a module weighting if this is firing before og, but that's a guess.
Comment #9
marcp commented@caschbre - I committed similar code to what you posted above and cut another beta. I suspect this fixes your issues.
@mikestefff - The code that I committed sets the context in all the same places that the node contexts set context. I'm hoping that this will work for you. There's one place in there that I don't really understand -- hook_ctools_render_alter() -- which I'm hoping will catch your Panels issue. If this doesn't work, then we can add in the call in
hook_views_post_render().Comment #10
caschbre commentedI'll take a look at it.
If it is any help, I'm working on a Context CCK module (http://github.com/caschbre/context_cck). It's on github until I can get a drupal cvs account. It's in very very early stages, but it is based on the Context 2.x module.
Comment #11
caschbre commentedbeta2 looks good so far.
Comment #12
mstef commentedHow's it going here...?
Can I help?
Did we fix anything?
Comment #13
mstef commentedBeta2 is looking good so far...looks like I'll ditch my custom thing and just use this..
On a side note: What's the current status with Context_og 3.x? Have these same issues been solved?
Comment #14
marcp commented@mikestefff - The idea is that Context OG 3.x will work in the same instances -- it's working great for us now, but we don't use Panels. If you switch to 3.x and it's not working with Panels, or whatever, then let's open up a new issue and we'll get it fixed there.
Comment #15
marcp commentedThis looks to be fixed, so I'm closing it out. Please open up new issues as you find them.