Unable to delete invalid form

Posted by Community Admin on 04-Aug-2018 15:09

Unable to delete invalid form

All Replies

Posted by Community Admin on 16-Nov-2011 00:00

Hi,

I have created form with invalid name through code:

var form = formManager.CreateForm("Feedback Form");
form.Title = "Feedback Form Title";
form.Name = "Feedback Form Name"; // This is invalid name which will break the form
formManager.PublishForm(form);
formManager.SaveChanges();

I have created and saved invalid form. Now I'm unable to go to Content -> Forms because exception gets thrown when I call
var formManager = FormsManager.GetManager();

Exception:

[ArgumentOutOfRangeException: The artificial type name must be a valid language independend identifier.
Parameter name: name
Actual value was Feedback Form Name.]
   Telerik.OpenAccess.RT.ArtificialBase.GenerateType(String nsname, String name, Type idFieldType, String idFieldName, String superClassName) +768
   OpenAccessRuntime.metadata.MetaDataBuilder.CreateArtificialTypes(PackageMetaData[] packageMetaDataParam) +1335
   OpenAccessRuntime.metadata.MetaDataBuilder.buildMetaData(DataObjectsRoot[] roots, Boolean ignoreNoClasses) +727
   OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b) +1321
   OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL() +184


It's easy to mistype the name and end up in a similar position. Is there a way to fix this through code or by modifying values in the database (something I'd like to avoid)?

I have tried to remove all the forms by doing the following:

foreach(var form in formManager.GetForms())
    formManager.Delete(form);

but I'm unable to execute this as I can't create a form manager.

Edit: This is by no way a solution, but it allowed me to carry on with prototyping. I have searched all SF tables for a string token and then removed all the rows where this string token appeared. This is something that we must avoid for a range of good reasons.

Thank you,

Viktor

Posted by Community Admin on 21-Nov-2011 00:00

Hello Viktor,

I believe I already answered you about this problem in the support ticket that you opened. So, I will close this thread, to not duplicate responses.

Kind regards,
Lubomir Velkov
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

This thread is closed