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.
Comment | File | Size | Author |
---|---|---|---|
#3 | og-context_not_correctly_set-1783678-3.patch | 457 bytes | Marty2081 |
#1 | og-context_not_correctly_set-1783678-1.patch | 367 bytes | Marty2081 |
Comments
Comment #1
Marty2081 CreditAttribution: Marty2081 commentedAnd here is a patch. Using str_replace() might not be the optimal solution, so please review.
Comment #3
Marty2081 CreditAttribution: Marty2081 commentedAttempt #2 for the patch.
Comment #4
Marty2081 CreditAttribution: Marty2081 commentedComment #5
amitaibuCommitted, thanks.