mandag den 2. december 2013

Upgrading Sitecore, Integer fields and the page editor

Just had an interresting issue with a customers solution, that we upgraded last week.

It seems, that if you have a template with a field, that is of the field type "Integer", something weird can happen.

To trigger this, you have to have three things:

  1. The field on the current page you are at.
  2. You have to be inside the page editor
  3. The field must be rendered using a <sc:text> tag.
If you do this, and then try and save the page without entering anything into the field (it might be optional for the user to enter something here, which was the case for our customer), you would get an error saying: " '' is not a valid integer.".

This happens, because Sitecore sometime between 6.5-111230 and the 6.6-130529 changed now the save event works, so it will give an error on Integer fields, even if there is no validators added to the field.

The solution we went for, was setting the field to have the default value of 0, which makes sure the field never is empty, which solved the problem.

Ingen kommentarer:

Send en kommentar