Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
As identified in issue #1423460: [META] List of bugs and typos in Drupal core found by Spleshka #12, hook_node_grants_alter was being passed $account, but using $user.
Proposed resolution
As this is my first attempt at addressing core API issues, patch is in first comment.
EDIT: Removed info about 2nd issue.
Comment | File | Size | Author |
---|---|---|---|
#3 | Define_user-1469758.patch | 554 bytes | chertzog |
#3 | Remove_op-1469758.patch | 2.99 KB | chertzog |
#1 | Remove_op_and_define_user-1469758.patch | 3.08 KB | chertzog |
Comments
Comment #1
chertzogAttaching patch for review.
Comment #2
Crell CreditAttribution: Crell commentedShouldn't these be two separate patches? It's confusing which part is talking about what.
Comment #3
chertzogSince the issues overlapped one the hook in question, i thought i would put them together, plus the one was simple. But here are patches separated.
#1423460: [META] List of bugs and typos in Drupal core found by Spleshka #12 is address with Define_user-1469758.patch
The others are addressed in Remove_op-1469758.patch
Comment #4
Crell CreditAttribution: Crell commentedIt's generally preferable to put a separate bug in a separate issue, too. Not just separate patch files.
Comment #5
chertzogOk. Renaming Issue to address the first issue.
#1423460: [META] List of bugs and typos in Drupal core found by Spleshka #12 is addressed with the Define_user-1469758.patch above.
Creating new issue to address second issue.
Comment #7
Crell CreditAttribution: Crell commentedThe green patch in #3 looks good visually, but I'm surprised it managed to last this long. Shouldn't we have a unit test to confirm that? It seems the sort of bug that would have broken rather drastically before now.
Comment #8
jhodgdonRE #6 - This is an example function in node.api.php, not anything that gets executed. As such it is actually just documentation, and I went ahead and committed it to Drupal 7/8.
Comment #9
Crell CreditAttribution: Crell commentedOh. Duh. That's what I get for only glancing at the patch. :-) Thanks, Jen.
Comment #10.0
(not verified) CreditAttribution: commentedRemoved info about second issue.