If the human readable name of a node type contains a dash, for example: 'news-item', the system name of the node type is 'news_item'. The path to add a node of that node type will be: /node/add/news-item. The og-context module assumes that the third item of the path is the node type system name which is incorrect (see line 379 of og_context.module). The subsequent call to og_get_group_audience_fields() will not return the fields for the node-type, thus the context is not set correctly. The system name of a node type can never contain a dash, so replacing any dashes by underscores is a solution.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Marty2081’s picture

Status: Active » Needs review
FileSize
367 bytes

And here is a patch. Using str_replace() might not be the optimal solution, so please review.

Status: Needs review » Needs work

The last submitted patch, og-context_not_correctly_set-1783678-1.patch, failed testing.

Marty2081’s picture

Attempt #2 for the patch.

Marty2081’s picture

Status: Needs work » Needs review
amitaibu’s picture

Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.