Scenario
A list is deployed using the OOB forms. Production data is added. We now need to add a custom form to the list.
The forms are added using this approach:
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<!- EditForm is now using TestEdit.aspx -->
<Form Type="EditForm" Url="TestEdit.aspx" Path="testedit.aspx" WebPartZoneID="Main" UseLegacyForm="FALSE" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
Source: http://sp2013.blogspot.com/2013/01/sharepoint-2013-list-custom-form.html This approach is how I've successfully been adding forms to a newly created list.
The problem is that when an updated list schema is deployed with the new form references, instead of showing the custom form, a blank modal is shown with a disabled Ribbon. When the list is deleted and recreated, the correct form is shown, but we cannot do this because we need to keep the list data.
Troubleshooting
Schema Comparing the schema returned by the ExportList method of the URL Protocol
TOP: A working list with custom form. MIDDLE: The broken list. BOTTOM: An OOB list.
<Form Url="Lists/WorkingList/DispForm.aspx" Name="{GUID}" Type="DisplayForm" Default="TRUE" UseLegacyForm="TRUE" FormID="0"/>
<Form Url="Lists/BrokenList/DispForm.aspx" Name="{GUID}" Type="DisplayForm" Default="TRUE" UseLegacyForm="TRUE" FormID="0"/>
<Form Url="Lists/OOBList/DispForm.aspx" Name="{GUID}" Type="DisplayForm" Default="TRUE" FormID="0"/>
Because the custom forms recognize the "UseLegacyForm" attribute, I believe the schema was updated with the reference to the custom form. Something else must be going wrong.
Breakpoint Breakpoints in the code behind of the custom form are not hit. Other breakpoints in the solution are. It seems this form is not being touched.
Not the Solution
These are the things I have already tried. 1. IISRESET 2. Deactivating/reactivating the feature. 3. Recycle app pool. 4. Using a rendering template custom form instead of the approach linked above.
What seems promising is setting the SPList.DefaultNewFormUrl property or SPContentType.NewFormUrl in the feature receiver, but the forms are not rendered properly (example: without a Ribbon).