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

Comments

rapsli’s picture

Status: Active » Needs review
rapsli’s picture

Version: 6.x-1.0-rc1 » 6.x-1.x-dev
StatusFileSize
new807 bytes

I found a very strange bug.

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.

gordon’s picture

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.

tjmoyer’s picture

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.

tjmoyer’s picture

Assigned: Unassigned » tjmoyer
Status: Needs work » Needs review
StatusFileSize
new1004 bytes

I've noticed that this issue is still a problem with the latest version of Domain Access Advanced. I'm providing an updated patch that works with the latest version of the module for review.

This issue causes the error mentioned above and causes the edit tab to disappear for all users, including uid 1, who should have access to everything.