1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Blog Custom Feild Bug

Blog Custom Feild Bug

2 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    19 Feb 2011
    Link to this post
    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
  2. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    21 Feb 2011
    Link to this post
    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
2 posts, 0 answered