Closed (fixed)
Project:
Domain
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2009 at 23:37 UTC
Updated:
15 Jun 2012 at 12:08 UTC
Jump to comment: Most recent file
multiple_node_access.patch no longer applies cleanly for Drupal 6.14.
Here's /path/to/drupal/modules/node/node.module.rej:
*************** function node_access($op, $node, $accoun
*** 2032,2053 ****
// If the module did not override the access rights, use those set in the
// node_access table.
- if ($op != 'create' && $node->nid && $node->status) {
- $grants = array();
- foreach (node_access_grants($op, $account) as $realm => $gids) {
- foreach ($gids as $gid) {
- $grants[] = "(gid = $gid AND realm = '$realm')";
}
}
-
- $grants_sql = '';
- if (count($grants)) {
- $grants_sql = 'AND ('. implode(' OR ', $grants) .')';
- }
-
- $sql = "SELECT COUNT(*) FROM {node_access} WHERE (nid = 0 OR nid = %d) $grants_sql AND grant_$op >= 1";
- $result = db_query($sql, $node->nid);
- return (db_result($result));
}
// Let authors view their own nodes.
--- 2032,2050 ----
// If the module did not override the access rights, use those set in the
// node_access table.
+ if ($op != 'create' && $node->nid) {
+ $grants_sql = node_access_grants_sql($op, NULL, $account, $node->status);
+ // If the return value is FALSE, then the node status is unpublished and
+ // none of the grants requested an access check be run. In which case,
+ // we should fall through to the final 'if' statement.
+ if ($grants_sql !== FALSE) {
+ if (!empty($grants_sql)) {
+ $grants_sql .= ' AND';
}
+ $sql = "SELECT COUNT(*) FROM {node_access} WHERE (nid = 0 OR nid = %d) $grants_sql grant_$op >= 1";
+ $result = db_query($sql, $node->nid);
+ return (db_result($result));
}
}
// Let authors view their own nodes.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | multiple_node_access.patch | 6.4 KB | agentrickard |
| #20 | multiple_node_access.patch | 6.39 KB | agentrickard |
| #7 | 579696-multiple_node_access.patch.patch | 1.25 KB | ken54671 |
| #5 | 579696-multiple_node_access.patch.patch | 11.14 KB | ken54671 |
| #2 | multiple_node_access.patch | 6.4 KB | ken54671 |
Comments
Comment #1
ken54671 commentedComment #2
ken54671 commentedRemoving extraneous AND
Comment #3
matteoraggi commentedthis patch is needed only for .dev or also for .rc9 version of domain access module?
Comment #4
agentrickardThe patch needs to apply to HEAD (6.x.2-dev), so it can be released.
Comment #5
ken54671 commentedPatch for HEAD.
Comment #6
agentrickardI love it when we have patches of patches.
Comment #7
ken54671 commentedRe-roll of the patch in #5. Patch for HEAD.
Comment #8
andrew.eatherington@gmail.com commentedHi, Is this the patch for the module?
Thanks
Comment #9
agentrickardUse this one for now --> http://drupal.org/files/issues/multiple_node_access_4.patch
Comment #10
andrew.eatherington@gmail.com commentedThanks. Just tried to run it in the root but no deal. Could you tell me which file it is supposed to patch?
Comment #11
agentrickardThe patch is malformed. Try changing this line:
To:
But, really, learn to patch.
http://drupal.org/patch/create
http://drupal.org/patch/apply
Comment #12
agentrickardActually, the patch was fine. See http://drupal.org/patch/apply for help.
Comment #13
agentrickardCommitted to HEAD. Thanks!
Comment #14
agentrickardThis is not an issue in D5.
Comment #15
andrew.eatherington@gmail.com commentedI've tried both and it still fails:
I used the command
in the root of domain module
Comment #16
agentrickardThis is a patch to Drupal core. Run it from Drupal root.
Comment #18
Jerome F commentedIt seems to me that this patch works fine with drupal 6.16
Could anyone more advanced than me confirm please ?
___
I have got :
$ patch -p0 < multiple_node_access.patchpatching file modules/node/node.module
Hunk #1 succeeded at 2037 (offset 5 lines).
Hunk #2 succeeded at 2099 (offset 5 lines).
Hunk #3 succeeded at 2137 (offset 5 lines).
Hunk #4 succeeded at 2146 (offset 5 lines).
Comment #19
agentrickardThat's all fine, but it needs a minor update. You are all set.
If you see 'failed' messages, then the patch did not apply cleanly.
Comment #20
agentrickardRevised version.
Comment #21
agentrickardSlightly better. Committed.
Comment #22
andybill commentedapplied, no probs so far - thanks!
Comment #23
Jerome F commented#21 applied with success
Thanks
Comment #25
danmed commentedHello,
Sorry to comment in a thread that's set to closed, but I looked around and this is la most recent info on the subject. I have a couple of questions:
- I am running Drupal 6.26, and the last version of the patch here does not apply (Hunk #1 FAILED at 2037. and so on). Is there a more recent version of the patch I could use? Is this patch "maintained" so it is updated with each core version?
- Is this patch still the way to fix things when wanting to use DA (with Domain Strict) along with Node Access for instance? If not, can you help and point me in the right direction?
Thanks a lot for your answer. This has now become a critical for my projects.
Edit: I made further searches and found out that the patch file is included in each DM module release, but neither the stable or the dev version ones work with core 6.26.
Comment #26
Encarte commented@danmed this post is closed, you should open a new one.