When adding a donation I get the error:

user warning: Field 'title' doesn't have a default value query: INSERT INTO uc_donate (nid, pid, type, weight) VALUES (4, 0, 'donation', 0) in F:\drupal\modules\ubercart\payment\uc_donation\uc_donate\uc_donate.admin.inc on line 134.

I can work this around by changing line 134 as specified above from:

db_query("INSERT INTO {uc_donate} (nid, pid, type, weight) VALUES (%d, %d, '%s', %d)", $form_state['values']['nid'], 0, 'donation', 0);

to

db_query("INSERT INTO {uc_donate} (nid, pid, type, weight, title) VALUES (%d, %d, '%s', %d, '%s')", $form_state['values']['nid'], 0, 'donation', 0, 'donationtitle');

But I suspect that...

'title' => array(
'description' => t('The title for a group.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE

might need altering instead in uc_donate.install to have 'not null' as false and the donations group form check the title.

Comments

greenskin’s picture

Title: Cannot add a donation with UC 6.x-2.4 » Cannot add a donation to Donate page
Status: Active » Fixed

Committed. Each insert now includes all fields even if essentially blank, 0 or '' rather than NULL.

Status: Fixed » Closed (fixed)

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