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.
Hi,
It's not possible to display correct relevant content block with Domain Access
module. Relevant Content block shows nodes from all domains.
"All node listing queries are supposed to be wrapped in db_rewrite_sql() in order
to enforce node access rules." [1]
Szy.
Comments
Comment #1
nicholasThompsonAh ok - thanks very much for this! I was concerned I might have to do a node_load and a node_access check on every link...
Comment #2
nicholasThompsonWill be applied soon.
Comment #3
ajayg CreditAttribution: ajayg commentedI do not see any patch attached.
Comment #4
ajayg CreditAttribution: ajayg commentedI made following change to 5.x version of the module and now it seems to respect node access.
Search for following line in the function relevant_content_get_nodes.
$result = db_query($sql, $values);
and change to
$result = db_query(db_rewrite_sql($sql), $values);
I tested this with 5.x version with OG node acess enabled.
Comment #5
fuerst CreditAttribution: fuerst commentedThis issue really is important and I hope it will be fixed soon.
Meanwhile you have to manually patch the module like mentioned in comment #4 which is somewhat uncomfortable.
Comment #6
ajayg CreditAttribution: ajayg commented@fuerst,
did you try the patch above as it is working for you? If it works then we can mark this ready to be commited.
Comment #7
fuerst CreditAttribution: fuerst commentedYes, it is working well.
Comment #8
muckermarc CreditAttribution: muckermarc commentedHi,
I changed the same line in Relevant Content v6.x.1-4 and it respected the access rights to nodes restricted via the Domain Access module.
Thanks to Szy for pointing me in the direction of this module, and to ajayg for the code snippet.
M
Comment #9
ajayg CreditAttribution: ajayg commented@nicholasThompson, please accept the patch. I submitted several months ago and have been reviewed by community for a while.
Comment #10
ajayg CreditAttribution: ajayg commentedCould we please get this patch in both 5.x and 6.x please?
Comment #11
nicholasThompsonAs I posted in another issue - I have been a bit quiet in the past few months as I've been organising my wedding in any spare time I had. My wedding and honeymoon are now finished :-( but on the positive side I should now have a little more time to dedicate to this. I plan to commit several patches from the queue plus some fixes from www.sportbusiness.com and finally update it to Drupal 7.
Thanks for the patience! :)
Nick
Comment #12
lal2017 CreditAttribution: lal2017 commentedI am using NodeAccess module - (Nodeaccess 6.x-1.3, http://drupal.org/project/nodeaccess) on Drupal 6.14, to restrict access to nodes. Seems similar problem as described by others above. Where Relevant Content block lists nodes which are restricted. Although when you actually click on them, it gives an access denied message. However I would like to hide these in the first place so users can't see what nodes are restricted.
Hopefully the fix is going well. Thanks for the module, its a gem.
Warm regards,
Raj
Comment #13
ajayg CreditAttribution: ajayg commentedAny update on this? CAn this patch be applied to 6.x branch
Comment #14
nicholasThompsonI'm going to sort this out very soon. I've been working on updating this and Page Title into Drupal 7. Fixes & features from that work will be backported to V6.
Comment #15
ajayg CreditAttribution: ajayg commentedSince this is only 1 line fix it will benefit the module 2 ways
1. It will solve the long pending need for the module users
2. This module hasn't seen a release in almost 1 year. Seeing the latest release date will help spread of this module.
Not that it will happen here, but I have seen too many times developer trying to combine a few things together and everything getting delayed because of one painstaking issue.
I am hoping since the community is already trying to help you by submitting patches, please give your attention. If other patch submitters see their patches are not getting commited (even after you agreeing those are correct patches) they will loose interest in helping you. My 2 cents.
Comment #16
ajayg CreditAttribution: ajayg commentedAny update on this ? Can this one line patch be commited?
Comment #17
Gabriel R. CreditAttribution: Gabriel R. commentedFor some reason, I don't see the patch files above :-s
Comment #18
nicholasThompsonI am going to commit this - I just need to find some time. I'm also working on upgrading all my modules to work in D7 too.. As well as writing SimpleTests to help avoid bugs in the future.
Comment #19
scor CreditAttribution: scor commentedSA-CONTRIB-2010-104 - Relevant Content - Information Disclosure