After updating to 1.0 "taxonomy_term"-view loses group context.

CommentFileSizeAuthor
#13 og_vocab_term_id-605138-13.patch672 bytespgillis
#7 og_vocab.patch581 bytespgillis
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

Status: Active » Postponed (maintainer needs more info)

I'll need some more info about it.

Pasi’s picture

I think this is a big problem. I am sorry if I gave too little info.

-I have "Group categories" block which displays my group taxonomy.
- I will see "taxonomy_term" view, when I click one of the terms (For example /taxonomy/term/7)
- I don't have any group context with this view. There is no "Group details" -block for example. There is nothing group related.

Previously I had the latest dev and all was good. I don't know what else info you need...

Thank you for your good work :)

Pasi’s picture

Status: Postponed (maintainer needs more info) » Active

I have the latest stable versions of all my modules and core drupal

Pasi’s picture

Priority: Normal » Minor

Still don't know what happened, but I got it working. I switched to "posts_by_term"-view and added a block with following PHP-code as argument:
if ($node = og_get_group_context()) {
return $node->nid;
}

jvieille’s picture

I am struggling with this same problem apparently. I keep asking questions about that on the OG Vocab and OG lists, but I am not very successful...

1) The Group Category block works well by default.
2) This happens al long as the "taxonomy_term" View is disabled (its default setting). This View emulates the Drupal core handling for taxonomy terms, so you normally don't see the difference when it is enabled.
3) If you enable the "taxonomy_term", the Group Category block does not work anymore: the group context is lost when clicking on a term.
This means that Views does not emulate Drupal core exactly. When OG Vocab Group Category bloc fire on clicking a term, Drupal Views seems to catch the call and processes it, but not fairly as far as OG is concerned. Whatever I tried to keep the context through default arguments failed .

4) by the way, you said that you found a solution. Have you succeeded at creating a bock similar to Group Category, with indented terms and displaying the View output to the content space?
Can you elaborate?

Thanks for help

jvieille’s picture

I found a solution:
http://drupal.org/node/763308#comment-2962022

The problem is that if the group nid is not in the url, there seem to be no way to get it from a menu item.
I succeeded only by changing the code that generated the link from the menu item in OG Vocab in order to add the group node id in the url.

pgillis’s picture

Priority: Minor » Major
FileSize
581 bytes

I am having this problem as well. In fact I have seen multiple issues reported for this module that seem to be, at the root, an issue with lack of group context. I am changing the priority to major in that this seems to be a significant problem. I know it is for my installation.

I have attached a file with a patch to og_vocab.module that makes the problem go away for me. It turns out that in hook_init, the module tries to load the term by getting the id from the first element of the page_arguments and then looking up the group context from the term. In the case of the view, the term is now the 3rd element.

Instead of getting the url from the page_arguments which is different in both cases I look to the map which has the same value where the term is the 3rd element.

What do you think? Thanks...

cray146’s picture

subscribe

javier.soler’s picture

I apply replace og_set_group_context(node_load($gid)); (ob_vocab.module > ob_vocab_init(), line 146)

by
$group_node = node_load($gid) ;

og_set_theme($group_node);
og_set_group_context($group_node);
og_set_language($group_node);

because the page lost the theme and language

jharder’s picture

Finding this patch was a miracle. Thank you for posting!

My OG vocab term pages were rendering in my site's default theme. After applying this patch the OG vocab term page has the correct group context and renders using my group theme.

I spent days trying to solve this!

pgillis’s picture

Status: Active » Needs review

Checking up on resolution of this issue. Changed status to needs review for patch.

Status: Needs review » Needs work

The last submitted patch, og_vocab.patch, failed testing.

pgillis’s picture

Status: Needs work » Needs review
FileSize
672 bytes

Generated new patch against DEV line.