More in this section
Forums / Bugs & Issues / Blog Custom Feild Bug

Blog Custom Feild Bug

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    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 str, Exception e) +36 script, Connection con, SqlDriver sqlDriver, Boolean noShredder) +365 script) +111 +288

    I have to have my host restore the DB now...which sucks
  2. Vlad
    Vlad avatar
    498 posts
    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,
    the Telerik team
2 posts, 0 answered