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
In node_node_access(), the calls to $account->hasPermission()
have a extra argument that shouldn't be there.
Proposed resolution
Remove the extra argument.
Remaining tasks
-
User interface changes
-
API changes
-
Data model changes
-
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff-9-12.txt | 1.23 KB | msankhala |
#12 | remove-obsolete-args-hasPermission-2883553-12.patch | 4.23 KB | msankhala |
#9 | 2883553-2_9.txt | 1.92 KB | govind.maloo |
#9 | 2883553-9.diff | 5.44 KB | govind.maloo |
#2 | 2883553-2.patch | 3.54 KB | seanB |
Comments
Comment #2
seanBComment #4
plopescI noticed this error as well. The patch looks good to me and tests are green :)
Comment #5
xjmI tried to think of any way this might break something. The only scenario I could come up with involved swapping out the entity access checker to call a different implementation of
AccountInterface::hasPermission()
that also did afunc_get_args()
(because an added parameter in the method signature would break the contract of the interface).That's pretty scifi, so I think we're fine.
I did find one more instance of this error though:
core/modules/node/tests/modules/node_access_test/node_access_test.module: if ($op == 'view' && $account->hasPermission('node test view', $account)) {
Comment #8
BerdirTagging novice for that additional usage.
Comment #9
govind.maloo CreditAttribution: govind.maloo at Salsa Digital commentedComment #10
govind.maloo CreditAttribution: govind.maloo at Salsa Digital commentedComment #11
BerdirThanks, looks like you accidently added an unrelated change though?
Comment #12
msankhala CreditAttribution: msankhala at Srijan | A Material+ Company commentedHere is updated patch
Comment #13
rcodina CreditAttribution: rcodina commentedPatch on #12 looks fine and it works for me!
Comment #14
BerdirThanks. There are about 3 different issues touching this function, it has more weirdness/bugs than lines of code. Lets see if we can get this one in this time ;)
Comment #15
BerdirComment #16
alexpottCommitted and pushed 269c716d1d to 8.7.x and 3e22551b1d to 8.6.x. Thanks!
I found one more using a regex....
Fixed on commit. I ran the test locally.