Custom field removal bug
- 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
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,
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?
"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.
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.
I got them to restart IIS as well as reboot the server...old one is still there.
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.
the Telerik team
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?
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.
the Telerik team
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
while the others don't
Would it still be permissions or is it something else?
All the files should update as when adding/removing custom field 4 configuration files should be updated