
jallad at optonline
Dec 31, 2008, 12:53 PM
Post #1 of 3
(1118 views)
Permalink
|
Hello, When running bric_dev_sync to move my elements and templates from a 1.10 install to 1.11, I got the following error : SOAP::Serializer::envelope: Server Application error Unable to execute SQL statement: DBD::Pg::st execute failed: ERROR: null value in column "min_occurrence" violates not-null constraint\n [.for Statement "UPDATE field_type SET element_type__id = ?, name = ?, key_name = ?, description = ?, place = ?, min_occurrence = ?, max_occurrence = ?, autopopulated = ?, max_length = ?, sql_type = ?, widget_type = ?, "precision" = ?, cols = ?, rows = ?, length = ?, vals = ?, multiple = ?, default_val = ?, active = ? WHERE id=?" with ParamValues: 11='textarea', 7=undef, 17='1', 2='Copy', 1='6', 18=undef, 16='', 13='50', 6=undef, 3='copy', 9='1024', 12=undef, 20='5', 14='8', 15='0', 8='0', 4='The inset copy text.', 19='1', 10='blob', 5='1'] at /usr/local/bricolage/lib/Bric/Util/DBI.pm line 1136 I'm not sure this is the right fix, but it looks like min/max occurrence just need non-null defaults. I added the following at line 1872 in Bric/Biz/ElementType/Parts/FieldType.pm: if (not defined $self->get_min_occurrence()){ $self->set_min_occurrence(0); } if (not defined $self->get_max_occurrence()){ $self->set_max_occurrence(0); } It seems to have fixed the bric_dev_sync issue, templates and elements look OK. . . hopefully helpful for anyone else having this issue. - Kahil
|