Project:Domain Access Advanced
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

Module works great. When creating a new Node I though always get this error:

warning: Missing argument 2 for domain_adv_node_access() in /var/www/tba/sites/all/modules/domain_adv/domain_adv.module on line 55.

I added a patch which fixes this issue

AttachmentSize
domain_adv.patch738 bytes

Comments

#1

Status:active» needs review

#2

Version:6.x-1.0-rc1» 6.x-1.x-dev

I found a very strange bug.

<?php
function domain_adv_menu_alter(&$callbacks) {
  foreach (array(
'node/%node', 'node/%node/edit', 'node/%node/delete') as $path) {
   
$callbacks[$path]['access callback'] = 'domain_adv_node_access';
  }
}
?>

node/%node/edit would not work anymore. As argument 'update' was just not being passed to the access callback function. No idea, why this happened.
So, I created a patch. Well, actually the second fix about the argument missing would then be void, as it's explicitely being passed.

AttachmentSize
domain_adv.patch 807 bytes

#3

Status:needs review» needs work

I have looked at this patch and I don't see the issue. The latest version has this fixed. Please test and let me know.

#4

I have run into this same problem. Strangely, on our development server the $op was was not being sent through for editing, and instead the $node object was coming through as the $op, leaving $node empty. On our production server 'view' was coming through as the $op for editing nodes. I'm not sure how this happened, as we're not changing any other part of the callback in the domain_adv_menu_alter() function, but it seems to have messed up at least that part of the callback array.

I propose adding back in the proper access arguments for each node operation.

We are also using Organic Groups (OG) and found that we had to make the Domain Access Advanced module heavier than OG so that domain_adv_node_access() would be used instead of OG's og_menu_access_node_edit(). This solved it for us.

However, as Domain Access Advanced does not pass off to node_access requests OG it's present, I'm concerned about what issues might come up that I'm not aware of yet. Seems like it should pass off to OG, if it's present and an update operation, which in turn passes off to node_access if it's not an OG node. So I'm including that in this patch, as well.

AttachmentSize
domain_adv-fix-access-arguments-for-node-access-function-705946-4.patch 1020 bytes
nobody click here