Blog Custom Feild Bug

Posted by Community Admin on 04-Aug-2018 17:17

Blog Custom Feild Bug

All Replies

Posted by Community Admin on 19-Feb-2011 00:00
The Custom field editor allows me to specify BIT on the type, but it tries to ALTER TABLE with bit(255) which fails, and then renders the entire site hosed because it keeps trying to insert the bogus datatype

I tried removing the mapping from the BlogConfig but that didn't work

[OpenAccessException: SQL exception on 'ALTER TABLE [sf_blog_posts] ALTER COLUMN [showImage] BIT(255) NULL' : Column, parameter, or variable #0: Cannot specify a column width on data type bit.]
   Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +7
   OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.throwBuildException(String str, Exception e) +36
   OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.ExecuteSqlScript(String script, Connection con, SqlDriver sqlDriver, Boolean noShredder) +365
   OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.runScript(String script) +111
   OpenAccessRuntime.DataObjects.tools.ant.ExecuteScriptTask.execute() +288

I have to have my host restore the DB now...which sucks
Posted by Community Admin on 21-Feb-2011 00:00
Hello Steve,

Yes, you are right. There is no validation for adding a custom field with incorrect db type, and unfortunately sometimes this could cause application to crash.
The only way to fix this problem is to delete the meta field directly in the database. In your case, the SQL script should be the following:

DELETE FROM sf_mt_fields_sf_meta_attribute
WHERE id IN
    (SELECT id FROM sf_meta_fields
        WHERE type_id IN (SELECT id FROM sf_meta_types WHERE assembly_name = 'Telerik.Sitefinity.Model' AND class_name = 'BlogPost')
            AND (column_name is null AND field_name = 'showImage') OR ((column_name = 'showImage')))
 
DELETE FROM sf_meta_fields
WHERE (type_id IN (SELECT id FROM sf_meta_types WHERE assembly_name = 'Telerik.Sitefinity.Model' AND class_name = 'BlogPost'))
    AND (column_name is null AND field_name = 'showImage') OR ((column_name = 'showImage'))

This problem is logged as a bug in our bug tracking system with ID: 108587.
We are sorry for the inconvenience. I updated your Telerik points.

Kind regards,
Vlad
the Telerik team
This thread is closed