Mailing List Archive

Error creating new contact
Hi,

I was trying to create a new contact via Bricolage API using Bric::Biz::Contact->edit_type() and got the error:

--
Unable to execute SQL statement: DBD::Pg::st execute failed: ERROR: column "alertable" is of type boolean but expression is of type integer
LINE 2: ...SERT INTO contact (id, type, description, active, alertable)
^
HINT: You will need to rewrite or cast the expression.
[.for Statement "
INSERT INTO contact (id, type, description, active, alertable)
VALUES (NEXTVAL('seq_contact'), ?, ?, ?, 0)
" with ParamValues: 1='Citizen ID', 3='1', 2='Citizen card number'] at /servers/bricolage/lib/Bric/Util/DBI.pm line 1084.

[/servers/bricolage/lib/Bric/Util/DBI.pm:1084]
[/servers/bricolage/lib/Bric/Biz/Contact.pm:900]
[test_contact.pl:6]

[/servers/bricolage/lib/Bric/Util/DBI.pm:1088]
[/servers/bricolage/lib/Bric/Biz/Contact.pm:900]
[test_contact.pl:6]
--

The problem was fixed by sending the zero value to the prepared statement parameters. Find the attached patch.



--
David Oliveira
<d.oliveira@prozone.org>
Re: Error creating new contact [ In reply to ]
On Jan 18, 2010, at 9:25 AM, David Oliveira wrote:

> The problem was fixed by sending the zero value to the prepared statement parameters. Find the attached patch.

Applied in rev_1_10 and master. Thanks!

David