After a normal update to 6.x-2.3, all ads fail to display. Inside the ad block, there is just a comment that says "no active ads were found in tnnn" where nnn is the block ID.

I am using ad, ad channels, ad file cache, ad weight probability, image ad and ad owners.

So far, I have tried the following steps to debug the problem:

I have disabled and re-enabled the module.

I have disabled and re-enabled existing ads.

I have disabled and re-enabled the blocks.

I have moved ads in and out of the ad groups and blocks.

I have created new ads.

I have tried disabling the ad cache.

I have tried running update.php a second time.

I have cleared all caches in performance settings (and wasn't caching anyway)

I have tried turning on all sub-modules (except actions and charts, which have dependencies)

Nothing works.

Comments

john franklin’s picture

Did you upgrade from 6.x-2.2 or some older version?

MadOverlord’s picture

PS: I checked the various log files, no error messages are being thrown.

MadOverlord’s picture

From 6.x-2.2, at the same time as I updated date, ubercart, and views_data_export

MadOverlord’s picture

Also, I'm still running Drupal core 6.24

MadOverlord’s picture

And as one further data point, if I just pop the 6.x-2.2 code back into the .../modules/contrib folder, the ads instantly re-appear.

Some more background: I have two groups (top and sidebar) and two channels (top and sidebar), and all the ads in the top group are in the top channel, and likewise for sidebar. The ads show as active. They are image ads with no text, not using premiere checkbox, default scheduling (in other words, none), various probabilities.

MadOverlord’s picture

I had some time this morning so I did some more investigation. I enabled debug output and the ads are all getting discarded in adserve_cache_get_cache because they don't have channels. Except that all of them do.

I have two containers, each of which contains a single channel. Each ad belongs to one group and one channel.

[18-May-2012 08:54:59] Invoking cache function 'adserve_cache_get_cache'.<br />

[18-May-2012 08:54:59] ad_channel_cache: checking aid(354)<br />

[18-May-2012 08:54:59] ad_channel_cache: aid(354) has no channel info, nochannel_display(2)<br />

[18-May-2012 08:54:59] ad_channel_cache: aid(354) is not valid<br />

[18-May-2012 08:54:59] ad_channel_cache: checking aid(473)<br />

[18-May-2012 08:54:59] ad_channel_cache: aid(473) has no channel info, nochannel_display(2)<br />

[18-May-2012 08:54:59] ad_channel_cache: aid(473) is not valid<br />

The previous version of ad generated output like this:


[18-May-2012 09:13:44] ad_channel_cache: checking aid(349)<br />

[18-May-2012 09:13:44] ad_channel_cache: checking aid(349) against channel(3) path(node/23) regexp(/^()$/) match(0) display[0]<br />

[18-May-2012 09:13:44] ad_channel_cache: aid(349) is valid<br />

[18-May-2012 09:13:44] ad_channel_cache: channel(3)<br />

[18-May-2012 09:13:44] ad_channel_cache: checking aid(354)<br />

[18-May-2012 09:13:44] ad_channel_cache: checking aid(354) against channel(3) path(node/23) regexp(/^()$/) match(0) display[0]<br />

[18-May-2012 09:13:44] ad_channel_cache: aid(354) is valid<br />

[18-May-2012 09:13:44] ad_channel_cache: channel(3)<br />

[18-May-2012 09:13:44] ad_channel_cache: checking aid(473)<br />

[18-May-2012 09:13:44] ad_channel_cache: checking aid(473) against channel(3) path(node/23) regexp(/^()$/) match(0) display[0]<br />

[18-May-2012 09:13:44] ad_channel_cache: aid(473) is valid<br />

I did some more checking and in ad_channel_cache_filter(), the following code always fails because $channels['ads'][$aid] is always NULL.

if (is_array($channels['ads']) && isset($channels['ads'][$aid]) &&
is_array($channels['ads'][$aid])) {

MadOverlord’s picture

I believe I may have found the error, in file ad_channel.module, function ad_channel_ad_build_cache() line 562

6.x-2.3 changes this line from this (in the previous version)

$result = db_query('SELECT chid FROM {ad_channel_node} WHERE nid = %d', $ad->aid);

to this (in -2.3):

$result = db_query('SELECT chid FROM {ad_channel_node} WHERE nid = %d', $ad->nid);

Note the change from $ad->aid to $ad->nid

Reverting this change (to "$ad->aid") restores display of ads.

john franklin’s picture

Looking at the code, especially the SQL query only a few lines above it, that's clearly the right answer. Thanks for the fix. Look for a 2.3.1 shortly.

john franklin’s picture

Component: ad module » ad_channel module
Status: Active » Fixed

Marking fixed and moving to the root cause module: ad_channel.

john franklin’s picture

d.o doesn't grok 2.3.1 as a valid release version number, a bug IMHO, so it's called 6.x-2.4.

ps. @MadOverlord, check your profile page. :)

MadOverlord’s picture

LOL, thanks John. Glad I could be of service.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.