This great module is not compatible with the Organic Groups module.
The OG module changes how the node/%node/edit callback works. Normally this callback is passed in 2 parameters: $op and $node. OG changes this to just $node.
The fix for Translation Acces: i18n_acces.module add these lines after line 105 (global $user;):

  // The og module changes the parameter orde of the node/%/edit menu item: catch it
  if (!empty($op->nid)) {
    $node = $op;
    $op = 'update';
  }

It would be better if OG did not change how basic Drupal stuff works offcourse... But this fix is probably a bit easier to implement :)

Comments

toemaz’s picture

Would it be possible to make a patch? Also the description is far from clear "// The og module changes the parameter orde of the node/%/edit menu item: catch it". I'm trying to bend my brain to understand what it means.

freakalis’s picture

I hade the same issue when building a site with both OG and i18n_access. I wrote my own custom callback that checks access for both OG and i18n_access

/**
 * Implementation of hook_menu_alter().
 */
function custom_mod_menu_alter(&$callbacks) {
  // Use _volvoce_mod_node_access() instead of node_access().
  $callbacks['node/%node/edit']['access callback'] = '_volvoce_mod_node_access';
  $callbacks['node/%node/edit']['access arguments'] = array('update', 1);
}

/**
 * Access control for both i18n_access and OG
 * @param $op
 * @param $node
 * @return unknown_type
 */
function _custom_mod_node_access($op, $node){
  $access = FALSE; 
  
  // i18n_access
  $access = _i18n_access_node_access('update', $node); 
  
  if($access) {
    // Check Oraganic Group Access
    $access = og_menu_access_node_edit($node);
  }
  
  return $access;
} 
toemaz’s picture

Nice trick.

I bet it will occur more that 2 modules are both altering the menu. I have no idea whether D7 has a solution for this or not. For the time being, we'll need manually fix the clash I presume.