Forum OpenACS Q&A: Response to can't delete a record in ec_custom_product_field_values

Hello Everyone,

I could not find the SDM for the Ecommerce 4.x package. Should I put the patch in the Ecommerce (ACS 3 Based) ?

Anyways here is what fixed it. Thanks to Dan for helping me out on the trigger.

The culprit is in package/ecommerce/sql/postgresql/ecommerce-create.tcl

create function ec_custom_p_f_values_audit_tr ()
returns opaque as '
begin
        insert into ec_custom_p_field_values_audit (
        product_id,
        last_modified,
        last_modifying_user, modified_ip_address
        ) values (
        old.product_id,
        old.last_modified,
        old.last_modifying_user, old.modified_ip_address
        );
		if TG_OP = ''INSERT'' then
			return new;
		else
			return old;
		end if;
end;' language 'plpgsql';

create trigger ec_custom_p_f_values_audit_tr
after update or delete on ec_custom_product_field_values
for each row execute procedure ec_custom_p_f_values_audit_tr();

Thanks Again.