Closed (fixed)
Project:
Contextual Administration OG
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jan 2012 at 10:24 UTC
Updated:
25 Jan 2012 at 06:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
cpliakas commentedHi mwallenberg.
Thanks for posting. I am trying to figure out whether this is a bug report of a feature request. Could you help me understand a use case where the node ID would not be the group ID? The more detail the better, as I want to make sure I understand the issue completely.
Thanks,
Chris
Comment #2
cpliakas commentedComment #3
mwallenberg commentedAs I have understood it, a group ID is separate from a node ID in most cases. Suppose, for example, that you have a site with 20 nodes on it already (none of them being groups). A new node is then created, and this node is specified as a group. It would have nid 21 and gid 1. If another node should be assigned to this group, the group audience field should be populated with the gid (1) rather than the nid (21) for it to work correctly.
There is a common case when the nid and gid will be the same: if the first node on the site is also the first group on the site. In this case, both nid and gid will be 1. But this is a special case, rather than the norm.
Thank you for writing this module - it is a great improvement over the "Content Create Links".
Comment #4
mwallenberg commentedI have attached a proposed solution. It loads the node, extracts the group ID from it and then uses that to set the group membership. It works fine with the combination of modules I listed above.
Another option would be to act on a group ID context instead of a node ID context, but that would require a bigger overhaul of the module, and I don't have enough in-depth knowledge of contexts to pull that off at the moment.
Again, thanks for a great module!
Comment #5
mwallenberg commentedComment #6
cpliakas commentedAh, I understand the issue now. Thanks for explaining and posting a patch! Re-rolling with some defensive coding, but the logic is the same. The real patch is mostly whitespace differences, so I am attaching a no-whitespace patch as well to better highlight the changes.
Thanks!
Chris
Comment #7
cpliakas commentedCommitted at http://drupalcode.org/project/context_admin_og.git/commit/f3ea609. This fix will be reflected in the 7.x-1.1 release.
Congrats on your first credited commit!
~Chris
Comment #8
mwallenberg commentedThanks! Glad to see it made it into the module.
/ Mattias
Comment #9.0
(not verified) commentedUpdated with more information.