KenticoDevTrev/KX12To13Converter

Inactive fields import in forms

Opened this issue · 1 comments

At least in Kentico 11 there was an option not to display a declared field in a form. After migration to K12 these form field definitions remained intact, which made sense as fields might be active in a past and might represent data in stored records. However, the K12ToK13Converter migration did not convert xml for such fields leaving overall form definitions corrupt and causing the whole form to be unusable. E.g. in our project after conversion an unused field xml definition:

<field column="PrimaryPartner" columnsize="100" columntype="text" guid="f16d98a4-0deb-4669-a5a0-29de6eebbe63">
      <properties>
        <fieldcaption>Name of Primary Partner</fieldcaption>
      </properties>
      <settings>
        <AutoCompleteEnableCaching>False</AutoCompleteEnableCaching>
        <AutoCompleteFirstRowSelected>False</AutoCompleteFirstRowSelected>
        <AutoCompleteShowOnlyCurrentWordInCompletionListItem>False</AutoCompleteShowOnlyCurrentWordInCompletionListItem>
        <controlname>TextBoxControl</controlname>
        <FilterMode>False</FilterMode>
        <Trim>False</Trim>
      </settings>
    </field>

and it must be something like

<field allowempty="true" column="PrimaryPartner" columnsize="500" columntype="text"
        guid="3e8615cb-18a1-4203-a23c-a8b5f3999142" visible="true">
        <properties>
            <fieldcaption>Name of Primary Partner</fieldcaption>
            <smart>False</smart>
        </properties>
        <settings>
            <componentidentifier>Kentico.TextInput</componentidentifier>
        </settings>
        <visibilityconditiondata>
            <VisibilityConditionConfiguration>
                <Identifier>Kentico.NeverVisible</Identifier>
                <VisibilityCondition />
            </VisibilityConditionConfiguration>
        </visibilityconditiondata>
    </field>

The tricky part is the ID, GUID, and Date fields were often also 'hidden', so was sometimes hard to differentiate between them. And i think originally when i did the conversion, the visibility never visible wasn't there...but i could be wrong on that.

I'll try to fix this up for future users, right now i'm the middle of taking over a business (it's on Kentico 12 PE) so i'm swamped with that, but i'll be working on it's migration and will try to get this in with that push to KX13 of it. Thanks for reporting and with a good idea for a fix.