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.
We have set up taxonomy terms to be groups for all sorts of awesome and cool reasons. But the OG Vocab widget didn't find the context until I patched og_context.module
with #2038575: "node" group types are the only context that can be automatically detected and passed the correct target type (taxonomy_term
in my case) to og_context()
in og_vocab_get_accessible_vocabs()
.
I'm not sure how/if this is related to #2007730: Integrate with OG-context to limit Og-vocab
Comment | File | Size | Author |
---|---|---|---|
#1 | 2038589-pass-group-type-1.patch | 678 bytes | dixon_ |
Comments
Comment #1
dixon_Here we go.
Comment #2
dixon_Clarified title.
Comment #2.0
dixon_Added possible duplicate/related issue.
Comment #3
amitaibuHi dixon_, welcome to the queue ;)
Committed, thanks.
Comment #4
amitaibuSorry, I've reverted this commit. The only fields sent to og_vocab_get_accessible_vocabs() are the taxonomy reference fields, so it will always be the taxonomy term, never a node (which is the typical use case).
I believe we'll have to figure out a solution for you need, in that other issue you opened in OG ;)
Comment #5
dixon_I don't fully understand what you mean. og_vocab only uses entity reference fields, so it should always be a entity reference field being passed to
og_vocab_get_accessible_vocabs()
, right?And to find the right group context, we must pass the right group type to
og_context()
, i.e. the entity type your group field is referencing. It works without passing entity type togo_context()
if you're looking for node groups. But once you setup taxonomy terms to be groups you're getting screwed byog_context()
since it assumes you're looking for nodes ;-)Comment #5.0
dixon_Flushing filter cache to update referenced issue title.