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

Forums / Bugs & Issues / Custom field removal bug

Custom field removal bug

11 posts, 0 answered
  1. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    26 Aug 2011
    Link to this post
    Hi,

    Scenario:
    - I added a custom field to Lists (long text type)
    - At some point, a few days later (site has been restarted and all), I removed the custom field

    It seemed to have worked fine, but I noticed the config files hadn't been modified (meaning the custom field is still referenced in ListsConfig.contentViewControls.ItemsBackend.views.*.config).

    After restarting the site, this is what I see:

    - When going to "Custom fields for list items", the custom field is no longer there
    - When editing a list item (for example), the custom field is visible
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    30 Aug 2011
    Link to this post
    Hello Thomas,

    The config files are not modified - this is by design. This is because even when you delete the custom field, its database column is left unmodified. I tried to reproduce your issue but after deleting the long text custom field for List Items and restarting the web server the editor for the deleted custom field was gone.

    Regards,
    Lubomir Velkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Richard
    Richard avatar
    64 posts
    Registered:
    09 Oct 2012
    21 Dec 2012
    Link to this post
    I've got this same issue...I'm pretty sure...

    I was trying to associate a thumbnail image with the blog post (seriously a mystery why this isn't baked in, since its been standard forever to have a thumbnail for blog/event/news posts and they already allow adding an image selector in module builder...). I originally used a custom field that I just copied and pasted the URL of the image into, but this isn't very functional for the Blog Authors.

    I saw this: 
    1. Add new custom field for blogs
    2. Set its type to short text
    3. Set "Interface widget for entering data" to Custom
    4. In the custom textbox enter:  Telerik.Sitefinity.Web.UI.Fields.ImageField
    5. Save the custom field and test it in blog post item.

    So I went into my Blogs content and deleted the Custom Field i'd created and created the new one as per the steps above. Then went to test it on a new blog post...Well the old thumbnail custom field is still there and the new one doesn't show up. I don't have the luxury of restarting the web server so is there another way to get this to change?
  4. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    21 Dec 2012 in reply to Richard
    Link to this post
    "seriously a mystery why this isn't baked in"
    I guess the reason is that the earlier Sitefinity 4.x versions did not feature a thumbnail type.

    Anyway, if I understand everything correctly, the new custom field you're trying to add has the same name as the old field. If so, the quickest way to work around the problem is to give the new field a different name. The problem is that all of the old field data is still in the database, and I don't know of any way to clean things up other than manually altering the database.
  5. Richard
    Richard avatar
    64 posts
    Registered:
    09 Oct 2012
    21 Dec 2012 in reply to Thomas
    Link to this post
    Thanks Thomas for the reply. I did try using a different name and it still didn't delete the old one or show the new one.
  6. Richard
    Richard avatar
    64 posts
    Registered:
    09 Oct 2012
    21 Dec 2012 in reply to Richard
    Link to this post

    I got them to restart IIS as well as reboot the server...old one is still there.

  7. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    05 Dec 2016
    26 Dec 2012
    Link to this post
    Hi,

    Delete the old field manually by going to Administration->Settings->Advanced->Blogs->Controls->Posts Backend->Views (here are the views where the custom fields show up) select BlogsBackendEditPost (the view when editing blog post)->Sections.
    In the list of sections there should be CustomFieldsSection where all custom fields added to blog posts are listed. Delete the unwanted custom field from here.
    All custom fields are saved locally in the project in App_Data/Sitefintiy/Configuration in separate config file for each type of content you have for Blogs there will be BlogsConfig.config and related config files for blogs where the custom fields can be found. When deleting a custom field sitefintiy will try to delete the field from those configuration files. Make sure the web server allows read./write permissions over App_Data folder where the config files are.

    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Richard
    Richard avatar
    64 posts
    Registered:
    09 Oct 2012
    04 Jan 2013 in reply to Stanislav Velikov
    Link to this post
    Thanks. That more or less worked. I actually had to go into each of the views (Administration->Settings->Advanced->Blogs->Controls->Posts Backend->Views)  with the CustomFieldsSection (BlogsBackendEditPost, BlogsBackendInsertPost, BackendBlogPreviewPostView, and PostsBackendVersionPreview) and delete the old one. I then tried adding the new custom field the standard way. It did not work. So then I went back to all of those views with the CustomFieldsSection, clicked Fields then clicked Create new and added an ImageFieldElement for the thumbnail custom field I wanted - filling in the necessary form fields (see attached image).

    So I'm worried that in the future If I want to add any additional custom fields to the Blog this is what I'm going to have to do...? I'm glad its working now how I want it, but  does anyone know how I can get it to function properly in the future?

    Thanks!
  9. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    05 Dec 2016
    09 Jan 2013
    Link to this post
    Hello,

    When cutom fields are added they are written to the configuration files in App_Data/Sitefintiy/Configuration/
    for news module refer to NewsConfig.(relatedViewName).config . Make sure when adding a field trough the UI the config file gets updated, if its not updated there are not enough permissions to sitefintiy to have read/write/modify access over App_Data folder.   

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Richard
    Richard avatar
    64 posts
    Registered:
    09 Oct 2012
    10 Jan 2013 in reply to Stanislav Velikov
    Link to this post

    Hmm that makes sense, but what I'm seeing is that two of the files in the App_Data/Sitefinity/Configuration folder get updated with the new custom field (BlogsConfig.contentViewControls.BlogsBackend.views.BlogsBackendEdit 
    BlogsConfig.contentViewControls.BlogsBackend.views.BlogsBackendInsert),

    while the others don't 
    (BlogsConfig.contentViewControls.BlogPostsFrontend.views.DetailBlogPostsFrontend,
    BlogsConfig.contentViewControls.PostsBackend.views.BackendBlogPreviewPostView,
    BlogsConfig.contentViewControls.PostsBackend.views.BlogsBackendEditPost, 
    BlogsConfig.contentViewControls.PostsBackend.views.BlogsBackendInsertPost,
    & BlogsConfig.contentViewControls.PostsBackend.views.PostsBackendVersionPreview)...

    Would it still be permissions or is it something else?

  11. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    05 Dec 2016
    15 Jan 2013
    Link to this post
    Hello,

    All the files should update as when adding/removing custom field 4 configuration files should be updated
    BlogsConfig.contentViewControls.BlogPostsFrontend.views.DetailBlogPostsFrontend,
    BlogsConfig.contentViewControls.PostsBackend.views.BackendBlogPreviewPostView,
    BlogsConfig.contentViewControls.PostsBackend.views.BlogsBackendEditPost,
    BlogsConfig.contentViewControls.PostsBackend.views.BlogsBackendInsertPost,
    If the filed updates only on two files test to delete all 5 configuration files, leave BlogsConfig.config (create a backup of the files before deletion)
    BlogsConfig.contentViewControls.BlogPostsFrontend.views.DetailBlogPostsFrontend,
    BlogsConfig.contentViewControls.PostsBackend.views.BackendBlogPreviewPostView,
    BlogsConfig.contentViewControls.PostsBackend.views.BlogsBackendEditPost,
    BlogsConfig.contentViewControls.PostsBackend.views.BlogsBackendInsertPost,
    BlogsConfig.contentViewControls.PostsBackend.views.PostsBackendVersionPreview
    and add new custom field. The configuration files deleted will get generated again and they all will reflect the new custom field.
    If the custom field is added in 4 of the configuration files test to add one more custom field to be sure the files can be modified.

    Regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
11 posts, 0 answered