Problem/Motivation
By not doing so, the filter prevents users from viewing content that they should be able to view on a site with no additional node access modules installed beyond core.
Steps to reproduce
Install standard profile
Add Content access: Access filter to admin/content view
Add user with Content editor role
Login as content editor and visit admin/content
Notice no content is shown
Proposed resolution
Check for implementations of hook_node_access before joining on access tables
Remaining tasks
Review
Commit
User interface changes
None
Introduced terminology
None
API changes
None
Data model changes
None
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|
Issue fork drupal-1822440
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 1822440-content-access-filter
changes, plain diff MR !982
Comments
Comment #1
dawehnerThis looks great.
I'm not sure what the proper way of getting patches from contrib to core would be, but i think for really simple patches it might make sense to forward-port them.
Comment #2
smira commentedthis applies cleanly, honestly not sure how to test what approach might be better ;)
Comment #3
jibranIt is a bug it needs some test to show the bug.
Comment #4
jibranAs per #3.
Comment #5
xjm(Merging "node system" and "node.module" components for 8.x; disregard.)
Comment #14
catchThis is still valid.
For adding a test, it would probably need a test view with the filter applied + some nodes, and then check the generated query to make sure it doesn't join on the node_access table.
Comment #15
mohit_aghera commentedComment #16
mohit_aghera commentedComment #17
mohit_aghera commentedAdding test-only patch.
Comment #19
mohit_aghera commentedComment #21
mohit_aghera commentedComment #22
catchTest coverage looks good, couple of nits:
Article vs. page mismatch between the comment and the code.
Maybe 'hook_node_grants()' instead of 'node_grant hook'.
Comment #23
mohit_aghera commentedResolved the feedback on the PR.
Comment #27
acbramley commentedTests have been added and initial feedback addressed, however the MR is still against 9.3.x so will need to be rebased against 10.1.x (is there a tag for rebase vs reroll?)
The issue summary could use a bit of sprucing up but not a deal breaker.
Comment #28
Ankit.Gupta commentedReroll the patch #17 with Drupal 10.1.x
Comment #29
mohit_aghera commentedHi @Ankit.Gupta
We don't need to upload the test-only patch.
Current MR already has the patch and the test case.
Hi @acbramley
I have updated the destination branch for the PR
Will trigger the build to see how it goes.
Comment #32
acbramley commentedRebased onto 11.x and tidied up the test a bit.
Comment #33
smustgrave commentedCan we add an issue summary?
Comment #34
acbramley commentedComment #35
smustgrave commentedShows test coverage
Actual change seems pretty straight forward, no issue and pipeline is green. I did rebase because it was 200+ commits
Comment #38
catchCommitted/pushed to 11.x and cherry-picked to 11.2.x, thanks!