Looking at this page: node_access_acquire_grants(), I'm thinking that the way the documentation is written, it is a little difficult to understand. Now it says this:
It is called at node save, and should be called by modules whenever something other than a node_save causes the permissions on a node to change.
But I'm thinking that it would be more clear if it were written like this:
This function is called at node save. Modules should [only] call this function whenever something other than a node_save causes the permissions on a node to change.
I had to read the original text a few times before I understood it - that's if I understood it! I guess the telling point is if the quote I added matches the original meaning or not.
Comment | File | Size | Author |
---|---|---|---|
#15 | node-module5-D6.patch | 1.97 KB | rdrh555 |
#14 | get-set-vars2-D6.patch | 1.3 KB | rdrh555 |
#11 | node-module4-D6.patch | 1.93 KB | rdrh555 |
#9 | node-module3-D6.patch | 1.93 KB | rdrh555 |
#7 | node-module2-D6.patch | 1.93 KB | rdrh555 |
Comments
Comment #1
jhodgdonAgreed, that function doc definitely needs a bit of cleanup. It also says "This function will call module invoke to...", which doesn't even mention which hook is invoked. Sheesh!
And it should be fixed in D7 first, then ported back to D6.
Comment #2
jhodgdonHere's a doc cleanup patch, for this function and the next one below it in the file. Should be ported to D6 if accepted.
Comment #3
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.
Comment #4
jhodgdonNeeds D6 port.
Comment #5
rdrh555 CreditAttribution: rdrh555 commentedComment #6
jhodgdonIn the D6 version of http://api.drupal.org/api/function/node_access_acquire_grants, there is actually no call to hook_node_access_records_alter() (i.e. no drupal_alter('node_access_records'). So this patch is not correct for D6.
Comment #7
rdrh555 CreditAttribution: rdrh555 commentedAh yes, only D7 lets modules alter the grants, thanks.
Comment #8
jhodgdonThe text looks right now. One minor line wrap issue:
I think collected should be on the previous line?
Comment #9
rdrh555 CreditAttribution: rdrh555 commentedI agree; this should do it.
Comment #10
jhodgdonSorry, missed this in the last readthrough:
All functions should have () after them, such as node_save(). This makes them turn into links on api.drupal.org.
Comment #11
rdrh555 CreditAttribution: rdrh555 commentedI added an underscore by accident; your patch did not do that and I assume wasn't meant to reference a function:
* modules if something other than a node save causes node access permissions
Removes the underscore:
Comment #12
jhodgdonThanks! That looks fine.
Comment #13
jhodgdonOops, spoke too soon. The patch needs to be rerolled from the Drupal root.
Comment #14
rdrh555 CreditAttribution: rdrh555 commentedgrrr, wrong setting in Eclipse, I think. Better?
Comment #15
rdrh555 CreditAttribution: rdrh555 commenteddouble grrr. IGNORE #14, wrong patch. Correct one:
Comment #16
jhodgdonLooks fine now, thanks!
Comment #17
Gábor HojtsyThanks, committed.