Closed (fixed)
Project:
DFP Small Business (Google Ad Manager)
Version:
6.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2009 at 05:35 UTC
Updated:
13 Aug 2010 at 21:10 UTC
Comments
Comment #1
highvoltage commentedThe ad slot blocks do not respect the visibility by role block settings.*
Couldn't edit...
Comment #2
toemaz commentedNice catch. Any chance of providing a patch?
Comment #3
highvoltage commentedI'm not a php programmer sadly. The best I can do is simply report the issue. Sorry x_x.
Comment #4
toemaz commentedWhile rereading this issue, I wonder whether it is really a bug in this module. I presume you do wish to show the block for auth users? If so, admin and mods are auth users as well which means that the block will be visible to them as well. Does this make sense to you?
Comment #5
highvoltage commentedI want to hide the ad blocks from moderators and administrators.
Display by role works for normal blocks... If all roles were treated as 'authenticated' first and another role(like moderator) second in terms of determining visibility there would be no hiding by role at all except those who were logged in and those who aren't.
Maybe i misunderstood you?
Comment #6
toemaz commented@highvoltage You're correct indeed.
Accepting patches.
Comment #7
jaydub commentedAs others mentioned, as long as you have 'authenticated user' role selected in block visibility by role it won't matter what other roles you have selected or not selected as all users in roles other than anonymous or authenticated will automatically receive the 'authenticated user' role and so the block visibility will not work in the way you wish.
What you can do is use the page specific block visibility settings and use a small snippet of PHP code to check if the user has the roles you want to exclude and if so do not display the block.
The example below would allow you to exclude the block from display when the current user is in the role(s) listed in the IF test:
Comment #8
jcisio commentedThis is a "by design" of Drupal blocks.
#7 gives an idea to have it done.