Per Nergård
Sep 14, 2012
  4114
(1 votes)

CMS5 to CMS6 upgrade. XForm validation

When upgrading a customer site from CMS5 to 6 we got some errors regarding XForms.

We got errors reporting of forms containing fields with names longer than 75 characters as well as forms with fields having duplicate names.

I wasn’t completely surprised that we got errors since my experience of upgrades of forms hasn’t been the best.

If your site isn’t migrated from 4.X you shouldn’t get any of these errors because EPiServer has added a lot of validation regarding forms starting from CMS5.

To avoid having to run the upgrade several times and so I next time can do a check for XForm problems in advance I  did a small program that goes through all forms checking for the type of errors we got in this particular case.

The program just prints out a table with the following information

Form-GUID, Form-name,Type of error found, PageId, Key

The PageId column contains a id to a page that uses the current form (it only contains one pageid even if the form is used on more pages), the key column contains the name of the offending XForm field if the error is a duplicate field.

To use it just download the zip file and drop the .aspx and .cs in your sites root folder and browse to it. If you later want to validate a specific form you can to by adding ?guid= to the url.

If you get many forms that aren’t used on any page it can be a bit of a pain locating them through the XForm UI, at least if you have a lot of forms. But there is a quick shortcut if you have the GUID.

Just add your site name, edit ui path and the GUID to the Url below and you will get straight into editing of the form.

http://yoursite.com/youreditpath/edit/XFormEdit.aspx?pageId=&parentId=&formid=fa8e1d3e-796c-426b-931a-a62bf51b9563&selectedFormName=/

 

* Update *

Added Henrik Stabergs suggestion to check for fields with id aswell. Wasn’t able to update the code section so the updated files can be downloaded from here

.

Sep 14, 2012

Comments

Sep 26, 2012 09:06 AM

Hi Per,
Thanks for a nice tool to validate xForms before upgrading!

I also got errors when upgrading xForms with input fields namned "id", "Id" och "ID".
More information in Tobias Nilssons article: http://world.episerver.com/Blogs/Tobias-Nilsson/Dates/2010/11/XForm-reserved-names-for-input-fields/

A check for this condition can easily be added to the method DoAllChecks(XForm xf) {...}

Sep 26, 2012 09:40 AM

Thanks for the input.

I've added the "id" check to the program but I have problem uploading it to the Code section.

Please login to comment.
Latest blogs
Opti ID overview

Opti ID allows you to log in once and switch between Optimizely products using Okta, Entra ID, or a local account. You can also manage all your use...

K Khan | Jul 26, 2024

Getting Started with Optimizely SaaS using Next.js Starter App - Extend a component - Part 3

This is the final part of our Optimizely SaaS CMS proof-of-concept (POC) blog series. In this post, we'll dive into extending a component within th...

Raghavendra Murthy | Jul 23, 2024 | Syndicated blog

Optimizely Graph – Faceting with Geta Categories

Overview As Optimizely Graph (and Content Cloud SaaS) makes its global debut, it is known that there are going to be some bugs and quirks. One of t...

Eric Markson | Jul 22, 2024 | Syndicated blog

Integration Bynder (DAM) with Optimizely

Bynder is a comprehensive digital asset management (DAM) platform that enables businesses to efficiently manage, store, organize, and share their...

Sanjay Kumar | Jul 22, 2024

Frontend Hosting for SaaS CMS Solutions

Introduction Now that CMS SaaS Core has gone into general availability, it is a good time to start discussing where to host the head. SaaS Core is...

Minesh Shah (Netcel) | Jul 20, 2024

Optimizely London Dev Meetup 11th July 2024

On 11th July 2024 in London Niteco and Netcel along with Optimizely ran the London Developer meetup. There was an great agenda of talks that we put...

Scott Reed | Jul 19, 2024