Hi

I have installed ad, image as and reports modules. When I click on an ad, i receive this error:


user warning: Unknown column 'extra' in 'field list' query: INSERT INTO ad_clicks (aid, uid, status, hostname, user_agent, adgroup, extra, hostid, url, timestamp) VALUES (1161, 1, 0, '127.0.0.1', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8', '0', '', '', 'http://....com/', 1238775259) in ...sites\all\modules\ad\ad.module on line 248

I checked the ad.install file and there is no definistion for field 'extra' in there. I believe it is missing there.

Comments

jeremy’s picture

Status: Active » Fixed

Thanks, fix committed.

Zombie777’s picture

I am getting it also, but only when I click on the ad and navigate away from the page then come back and click on any non ad in drupal.

jeremy’s picture

You'll need the latest code from CVS, or to wait for the next release.

mstef’s picture

[edit]

mstef’s picture

Still having problems:

Unknown column 'extra' in 'where clause' query: UPDATE ad_statistics SET count = count + 1 WHERE aid = 14174 AND action = 'view' AND date = 2009041017 AND adgroup = 't40' AND extra = '' AND hostid = '' in /home/poweron/public_html/sites/all/modules/ad/adcache.inc on line 299.

Installed and updated to the latest code..

mstef’s picture

From what I can assume, this is what is causing cron to not be able to finish for me - though not confirmed yet.

meppy’s picture

Having the same error, the table does not have that column, was considering adding it but unsure of what type to give it. Might try modifying the query and see what happens... I wonder if the table creation didn't work 100%?

meppy’s picture

This is the relevant code that should add the columns, I don't know enough about how modules work and are installed to understand why it hasn't worked, but I just added the columns based on this code and the problem _appears_ to be fixed.

function ad_update_6004() {
$ret = array();
db_add_field($ret, 'ad_statistics', 'extra',
array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Alow add-on modules to provide additional statistics granularity.',
),
array('indexes' => array(
'extra' => array('extra'))
));
db_add_field($ret, 'ad_clicks', 'extra',
array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'Alow add-on modules to provide additional statistics granularity.',
),
array('indexes' => array(
'extra' => array('extra'))
));
return $ret;
}

jeremy’s picture

Again, this is fixed in the -dev tarball, so either wait for the next rc, update to the -dev release, or fix it manually as meppy did in #8.

dresde’s picture

@meppy

So, I'm having the same problem and it took me so long to find this post!!! Where do I have to ad that code to fix the problem? Right today I updated to ad-6.x-2.0-rc1 and I still have the problem!

-----------
edit
----------
Ops, I just realized it is NOT the same problem. Mine is

user warning: Unknown column 'extra' in 'where clause' query: UPDATE ad_statistics SET count = count + 1 WHERE aid = 89 AND action = 'view' AND date = 2009041714 AND adgroup = '0' AND extra = '' AND hostid = '' in /usr/local/www/vhosts/mydomain/httpdocs/drupal/sites/all/modules/ad/adcache.inc on line 299.

Sorry

jeremy’s picture

The simplest fix is to force ad module's update 6004 to run.

Status: Fixed » Closed (fixed)

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

stanyul’s picture

I seem to be getting this error message when trying to upload ads with the ad module.

user warning: Table 'XXX123_drupal.XXXXXXX_ad_statistics' doesn't exist query: UPDATE XXXXXXXX_ad_statistics SET count = count + 1 WHERE date = 2010083008 AND aid = 875 AND action = 'update' AND adgroup = '' AND hostid = '' in /home/XXX123/public_html/sites/all/modules/ad/ad.module on line 328.

Any idea what might be causing this? I'm new to drupal and a wysiwyg'r... so any suggestions would help out great