Hello, i installed module today.
When I click in menu 'Affiliates Home' -> 'Affiliates' and try to add Category this shows:

* user warning: Unknown column 'weight' in 'field list' query: INSERT INTO affiliates_cats (cat_name, active, weight) VALUES ('Kategoria', 'Y', 5) in /ftp/labs/modules/affiliates/affiliates.module on line 595.
* user warning: Unknown column 'weight' in 'field list' query: SELECT cat_id, cat_name, active, weight FROM affiliates_cats ORDER BY weight DESC LIMIT 0, 50 in /ftp/labs/modules/affiliates/affiliates.module on line 693.

When i try view categories:

user warning: Unknown column 'weight' in 'field list' query: SELECT cat_id, cat_name, active, weight FROM affiliates_cats ORDER BY weight DESC LIMIT 0, 50 in /ftp/labs/modules/affiliates/affiliates.module on line 693.

The configuration options are at their default values.

CommentFileSizeAuthor
#6 affiliates_install.patch2.09 KBfred0

Comments

MadMakz’s picture

Same here? Is that project even still active?

kbahey’s picture

It is active and had a major rehaul of late, and an additional maintainer.

Please be patient while he responds.

Anonymous’s picture

Assigned: Unassigned »

Apologies for the late reply , looking into this now ...

Anonymous’s picture

Status: Active » Closed (fixed)

Thanks for the heads up , i need to update the documentation,

What you need to do is go to the "status report" page @ admin/reports/status
and find the section "Database updates" which should request you to update
the database to pick up the new field defined in the affiliates.install file ..

function affiliates_update_1() {
db_add_field($ret, affiliates_cats, 'weight', array('type' => 'int', 'length' => '3','default' => 0));
}

Please reopen if you need further assistance.

-Paul

fred0’s picture

Hmm... I just installed the dev version and am seeing this error right off the bat. Looking at the install file, I see that function listed at the end, but the field does not exist in my database.
Tried database update, but it didn't recognize that function as a needed update. I had to select it manually in the update list to get it to apply. It succeeded in adding the field, but I got this returned after the update:

• warning: array_merge() [function.array-merge]: Argument #2 is not an array in update.php on line 174.
• warning: Invalid argument supplied for foreach() in update.php on line 339.

fred0’s picture

StatusFileSize
new2.09 KB

Ok, after fixing a few things in the .module file (see here: http://drupal.org/node/100042#comment-1173863), I realized the .install file needed some work too. The attached patch fixes the update function, adds the weight to the initial install routine and inserts the weight value. It also fixes the uninstall routine.

kbahey’s picture

Committed.

Thanks fred0.