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.
API page: http://api.drupal.org/api/drupal/modules%21node%21node.module/function/_...
A comment for the code contains a typo: It says $acount
instead of $account
.
// If $account can bypass node access, or there are no node access modules,
// or the operation is 'view' and the $acount has a global view grant (i.e.,
// a view grant for node ID 0), we don't need to alter the query.
At the same time, I would replace i.e. with for example, as that is just an example of global view grant, or with such as.
I am reporting this for Drupal 7, as Drupal 8 doesn't define this function.
Comment | File | Size | Author |
---|---|---|---|
#5 | fix-typo-1856142-5.patch | 725 bytes | apaderno |
#2 | fix-typo-1856142-2.patch | 725 bytes | apaderno |
#1 | fix-typo-1856142-1.patch | 694 bytes | apaderno |
Comments
Comment #1
apadernoThis is the patch.
Comment #2
apadernoI found the Drupal 8 function: It's
node_query_node_access_alter()
. The patch I attach here is for Drupal 8.Comment #3
apadernoThe first patch fails because I changed the Drupal version associated with this issue; in fact PIFR is getting the code for Drupal 8, as it is evident from the log. (
[drupal.core.version] => 8
).Comment #5
apadernoLet's try again. I noticed there has been a commit right after I updated my local repository, and created the patch. I checked the patched file didn't cause any syntax error with
php -l
, and I didn't get any error.Comment #6
jhodgdonThanks! Committed to 8.x and 7.x.
Comment #7
tstoecklerAFAIC, this was only committed/pushed to a 9.x branch. Searching for this issue number on drupalcode.org yields only this. I don't know the reason for that, but I don't think it was intented this way.
Comment #8
Dries CreditAttribution: Dries commentedI believe this is applied to 8.x. When I try to apply it to the head of 8.x I get:
Comment #9
Dries CreditAttribution: Dries commentedSorry, I take that back. The snippet in my comment above appears to be the old documentation. That said, this patch no longer seems to apply. Asking for a re-test.
Comment #10
Dries CreditAttribution: Dries commented#5: fix-typo-1856142-5.patch queued for re-testing.
Comment #12
jhodgdonWell, I looked back into my command-line history and here is what I did when I committed that patch:
As a note, "cleanrepo" is an alias for
And I don't have anywhere in my git history where it says "git checkout 9.x". So I don't see how I could have committed it to the 9.x. The patch is there in 8.x.
Oh.... It looks like what you are seeing is that Dries created the 9.x branch just after I committed that patch. So that commit is the one that is tagged/branched as the start of 9.x. The patch was not committed to 9.x. We are fine. Take a look at:
http://drupalcode.org/project/drupal.git/shortlog/refs/heads/9.x
which basically has the entire history of 8.x up through that one commit, and then the 9.x branch is created at that last commit.
Comment #13
tstoecklerOK. I didn't know that the tagging of 9.x was intentional and what really put me off, that you can't find the commit on drupalcode.org for the 8.x branch. But apparently it was applied, so whatever. Sorry for the noise. And thanks for clearing that up.