Vulnerability in EPiServer.Forms
I've got some posts causing problems when I try to upgrade our site to CMS 6.0. The ID's are printed so I thought I'd just delete the posts but I can't find them. Where are they stored?
The site is fully functional even if these causes exceptions but I'd like to sort these out once and for all.
They are stored in tblItem, but if you plan to delete dem straight out of the table make sure you do it on a test database first. Have you tried using the API to delete the xform data? I wouldn't recommend deleting directly in the database.
Yes, this is a test database. How do I use the API to do this?
The simplest is probably if you can just list the xform data from edit mode and remove any form data you want. Otherwise you can use the XFormData.CreateInstance method to get the posting (you need to know it's guid) and then call the Delete method on the returned instance.
Just opening the form would of course be the easiest way to go but the exception in the installation leaves me with the ID, that's it. I have no idea in what form to find this.
I'll probably end up just upgrading and never mind about the Xforms. They are disposable anyways.
What kind of ID is it you get then (I thought it was the guid)? Can you post the full message?
Upgrading XForm Post - 1 of 17 with Id ce3d1eb6-89ea-4f3b-b40a-8b748925f9c7
An error occurred upgrading an XForm post
A store has not been created for posts of XForm with Id 2e2246a1-971e-4756-b077-30e244b66967. Is this an orphan post?
Upgrading XForm Post - 2 of 17 with Id f83b7d47-a2e8-4ac5-b28b-4f6073a49cb7
Upgrading XForm Post - 3 of 17 with Id a3ed0f0e-8fad-4c14-b0ba-920d39b71ff4
Upgrading XForm Post - 4 of 17 with Id 7ffc6c98-c000-4f19-b98e-49bcd6f11b88
A store has not been created for posts of XForm with Id 52c04029-3d1a-43e4-90cc-953792a92df8. Is this an orphan post?
Upgrading XForm Post - 5 of 17 with Id ae4105a6-dda3-4a1a-a1e7-8c6d42bc41e8
Upgrading XForm Post - 6 of 17 with Id 439a35a1-afae-4606-8116-fbbcfe8d150d
Upgrading XForm Post - 7 of 17 with Id 0f20c271-7ffe-4207-b975-eb356fd4ce5c
A store has not been created for posts of XForm with Id be7afb55-0443-4f53-b54e-214e8a79b8c0. Is this an orphan post?
Upgrading XForm Post - 8 of 17 with Id 214070cb-f333-43ba-acfc-7badce41b7a5
Upgrading XForm Post - 9 of 17 with Id dce84477-ad5a-442d-986f-ea8440c4ac6f
Upgrading XForm Post - 10 of 17 with Id 27f4b44e-7f07-462b-bce6-841299e378fa
Upgrading XForm Post - 11 of 17 with Id 2fa2a4dd-58b2-41d3-a815-821287f7fa1e
Upgrading XForm Post - 12 of 17 with Id 3cf1c431-312b-4d5d-9754-f7f4dd4274a6
Upgrading XForm Post - 13 of 17 with Id baffbbee-b2ac-42d9-aadf-976ca1c89f81
Upgrading XForm Post - 14 of 17 with Id 098e4a66-3eed-4b8b-b28d-0a3751d16283
Upgrading XForm Post - 15 of 17 with Id b7be37a8-605b-4d97-819f-2b5cc9c2a261
Upgrading XForm Post - 16 of 17 with Id 9fe286a1-c5e7-426a-a305-fbb1a88b8e16
Upgrading XForm Post - 17 of 17 with Id e919384f-934e-4d0b-b0fc-ad99ebb726cb
An unhandled error has occured:
Completed with errors - see Additional Information window
At C:\Program Files\EPiServer\CMS\6.0.530.0\Upgrade\System Scripts\Migrate Data
+ Upgrade-EPiXForms <<<< -SelectedSite $wizard.SelectedApplication
Error - System.Management.Automation.CmdletInvocationException: Completed with errors - see Additional Information window ---> System.ApplicationException: Completed with errors - see Additional Information window
at EPiServer.Upgrade.CMS5.XFormUpgrader.Upgrade(String connectionString, String dbProviderName, Boolean oracle)
--- End of inner exception stack trace ---
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
Those are indeed the guids of the posts. If you do XFormData.CreateInstance(new Guid("guid from error message goes here")).Delete() you should get rid of them. Then hope there are no more orphans than those 17 :)
I get "Object reference is not set to an instance...." when I try to do that... :/
Weird, that seems to indicate that it is already removed (CreateInstance returns null). I have no further suggestions then.
Did you solve it Magnus? If you didn't I think it's because you are using EPiServer CMS 6 and I think it stores XForms in a different way than how the 5 did it. Use Reflector to look at the XFormData Delete() method in a CMS 5 dll, to see how they do it there and copy that code.
I gave up and upgraded the site last night and everything is "fine and dandy". :)
Thanks for your effort! Appreciate it!