Display type is set to JavaScript. Using admodule-supplied blocks.
For logged-in users, ads are properly shown with channel restrictions applied.
For anonymous users, channel restrictions do not apply: instead, all the ads from the group are shown, not only those assigned to a channel.
Disabling Drupal block caching fixes the problem.
Re-enabling block caching, then visiting a specific page (with channel restrictions) for the first time shows proper ads; further visits of pages configured for other channels keep showing the initial ads (from a different channel).
The question is: is this a bug in Drupal's block caching mechanism, or somewhere in admodule?
Block's code looks like this:
<div class="advertisement group-tids-2339" id="group-id-tids-2339">
<script type='text/javascript' src='http://example.com/sites/all/modules/ad/serve.php?q=1&c=file&f=3&p=files&t=2339&u=taxonomy%2Fterm%2F15'></script></div>
I'm using FireFox 3.0.14, no specific caching modules installed.
Comments
Comment #1
tetramentis commentedSwitching to jQuery display method didn't help (however, first page load after display type change did have a properly channel-filtered ad).
Both iframe and raw still have the same problem. This issue appears to be displayMethod-independent.
Comment #2
jeremy commentedThanks for reporting this. You tracked down enough details that I was able to fix it:
http://drupal.org/cvs?commit=277522
If you don't want to upgrade your ad module at this time, you can simply run the following SQL query directly in your database to fix this:
UPDATE blocks SET cache = 4 WHERE module = 'ad';The fix is to cache ad blocks on a per-page basis.
Comment #3
tetramentis commentedThank you, this worked.