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.
For the OpenScholar profile, we need to remove this function for performance issues.
Comments
Comment #1
baisongPatch attached
Comment #2
baisongSame patch against 7.x-2.0
Comment #3
pgillis CreditAttribution: pgillis commentedHave you tried version 7.x-2.1 yet? There were some changes there to address performance issues with hook_node_grants.
That said, without the hook_node_grants implementation admins will not be able to grant view permission to group members to view unpublished content.
Comment #4
pgillis CreditAttribution: pgillis commentedComment #5
pgillis CreditAttribution: pgillis commentedComment #6
rbrandon CreditAttribution: rbrandon commentedCorrected patch against 7.x-2.0
Comment #7
rbrandon CreditAttribution: rbrandon commentedLooks like this was never tested, replaced node_grants with node_access to achieve what oren was doing.
Comment #8
rbrandon CreditAttribution: rbrandon commentedDoh, same as above without fat fingers.
Comment #9
pgillis CreditAttribution: pgillis commentedBelieve me, I share your concern about the performance of this function but I don't know any way around it. Perhaps there is something we can do with this function to make it perform better. The reason we need to keep it is because of node listings. There is more information at Node Access Rights.
In my deployment I depend on view listings and need the permissions working there.
The reason I asked if you tried against 7.x-2.1 in comment #3 is because there was a substantial improvement in the performance of this function in that release. You can see I was walking down essentially the same path as you a few months ago, Node access too slow when current user is member of large number of groups.
Comment #10
shenzhuxi CreditAttribution: shenzhuxi commented@baisong @rbrandon Did pgillis's patch solve the performance problem? I find Open Scholar is still using
https://github.com/openscholar/openscholar/blob/SCHOLAR-3.x/openscholar/...