This module is not working with Drupal 6.xx + PostgreSQL. The problem is in the db queries. There is wrong usage of chars: '`', '{', '}' in this module.

Original query with bug:
db_query("alter table {uc_extra_fields_values} add column `%s` VARCHAR(255), add column `%s` VARCHAR(255)", $billing_field_value_name, $delivery_field_value_name);

Corrected query:
db_query("alter table uc_extra_fields_values add column %s VARCHAR(255), add column %s VARCHAR(255)", $billing_field_value_name, $delivery_field_value_name);

Could you append this patch to the future version? Or do you need any more info?

Thanks for this helpfull module.

Comments

maurizio.ganovelli’s picture

Assigned: Unassigned » maurizio.ganovelli

Hi,
Thanks for reporting this problem.
I think it's better to use schema api db_add_field (and also db_drop_field) to resolve this issue.
Can you verify this portion of code on your installation?

$test=array();
$spec=array('type' => 'varchar', 'length' => '255', 'not null' => FALSE);
db_add_field($test, 'uc_extra_fields_values', $billing_field_value_name, $spec);
db_add_field($test, 'uc_extra_fields_values', $delivery_field_value_name, $spec);
tomi2846’s picture

Yes, this works good on my installation. Thank you.

maurizio.ganovelli’s picture

Status: Active » Fixed

Hi tomi2846,

in the last commit, i've fixed this issue, using db_add_field/db_drop_field api.
Let me know if there are still problems or if it works.

Bye.

Status: Fixed » Closed (fixed)

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