Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dejan.maric.max’s picture

Hi Sarenc,

I've rewrote the module to accomplish that (Sorry SUN, it is quite simple patch that you can include in main branch)

so Now You can choose default role to be different by OG content type

sun’s picture

Title: allow default role to be different by content type » Allow different default role by content type
Version: 6.x-4.1 » 6.x-4.x-dev
Status: Active » Needs work

@destination_node: Can you attach a patch with the required changes for this issue only?

mrfelton’s picture

Status: Needs work » Needs review
FileSize
7.6 KB

Here is the above as a patch against the latest in CVS.

massud’s picture

There is a bug in this patch. Node is not loaded for user update case in the hook_og() implementation:

function og_user_roles_og($op, $nid, $uid, $args = array()) {
  switch ($op) {
    case 'user insert':
      ...
    case 'user update':
      $default_admin_role = variable_get('og_user_roles_default_admin_role_'.$node->type, 0);
      ...

should be like this:

function og_user_roles_og($op, $nid, $uid, $args = array()) {
  switch ($op) {
    case 'user insert':
      ...
    case 'user update':
      $node = node_load($nid);
      $default_admin_role = variable_get('og_user_roles_default_admin_role_'.$node->type, 0);
      ...
held69’s picture

subscribing

hefox’s picture

Status: Needs review » Needs work
FileSize
4.14 KB

Haven't tested it quite yet, but here's a patch with the above in mind. the preview patch also had an unrelated slight bug fix, so did not include that.

However, settings this to needs review as the upgrade patch for existing sites isn't handled.

izmeez’s picture

subscribe

hefox’s picture

Updated to remove calls during node_load during hook_nodeapi 'insert' (as user [author] is added during insert of group)

hefox’s picture

Add setting the cache during 'insert' to prime it for user insert

hefox’s picture

Missed a spot needing to be changed