Importing a form with conditional fields (Contour 3.0)
We have recently upgraded to Contour 3.0 on a site (still working with Umbraco 4.7.1.1*) and have been unable to import forms with conditional fields into our staging environement. The error I am getting is as follows:
The
INSERT statement conflicted with the FOREIGN KEY constraint
"FK_UFFieldConditionRules_UFFields". The conflict occurred in
database "Umbraco_db", table "dbo.UFFields", column
'Id'. The statement has been terminated.
I can see that contour is trying to create objects in the database in the wrong order, yet the import file is in XML not a SQL script so I cannot run this in isolation. Is this a known issue or is there a workaround? This form needs to go live pretty soon.
*We have a lot of custom code dependancies so upgrading Umbraco is not currently an option for us.
Ok I can see why this is happening so looking into a fix
Basicly it's because the fields don't have an id in the export (it creates a new id in import) but the conditions do have the fieldid stored so it's trying to insert a condition with a field id that doesnt exist
Thanks Tim! i'm able to export and import on 2 different sites both using Contour 3.0.15WIP with conditions in the forms, and no errors. I do have an unrelated issue, but will start a new thread..
For the record, we're also not able to delete imported forms.
Still on contour 3.0.15 WIP here because we need to be able to export/import between staging and live / Umbraco 4.11.8
Additionally, we are having a problem with a mandatory radio button list not passing validation when one of the items is selected (this happens in preview and also when the form is used)
Thanks for the quick response! The only change i'm aware of is to /umbraco/plugins/umbracoContour/Views/Form.cshtml - the location of the DefaultForm.css is changed to the site/css directory so our Editor can change the styles.
I will compare the contour directories against the 3.0.15 WIP files again and let you know if any others were changed..
I'm able to reproduce with a fresh install of Umbraco 4.11.8, no modifications, installed Contour 3.0.15 WIP.
Created template to display the form adding the 4 required jQuery references for Contour version 3.x + (jquery-1.8.2, jquery-ui, jquery.validate, and jquery.validate.unobtrusive)
Create form with 1 mandatory radiobuttonlist and 1 conditional Textfield based on the radiobuttonlist
Preview form from Contour editForm page (uses previewFormDialogMvc.aspx)
Select one of the radio button list items, click submit, receive mandatory message (expected to be able to submit without receiving mandatory message here).
Insert form on content page using "Insert form from Umbraco Contour (Razor)" macro.
Save & Publish content form
View in browser, select one of the radio button list items, click submit, receive mandatory message (expected to be able to submit without receiving mandatory message here).
Tested in both IE 9, and Firefox 24. (no script errors in either browser, and conditional field is working correctly in preview / form view)
Importing a form with conditional fields (Contour 3.0)
We have recently upgraded to Contour 3.0 on a site (still working with Umbraco 4.7.1.1*) and have been unable to import forms with conditional fields into our staging environement. The error I am getting is as follows:
I can see that contour is trying to create objects in the database in the wrong order, yet the import file is in XML not a SQL script so I cannot run this in isolation. Is this a known issue or is there a workaround? This form needs to go live pretty soon.
*We have a lot of custom code dependancies so upgrading Umbraco is not currently an option for us.
Has anyone else come across this issue?
Comment author was deleted
Hey Jo,
What version of Contour are you runnning?
Comment author was deleted
Looks like you need to be running at least 3.0.10 for it to work
Comment author was deleted
But that version doesn't work with your Umbraco version ... so you'll need to upgrade Umbraco...
Thanks for your help Tim.
Apparently we are running v3.0.12 of Contour - is this version incompatible with our version of Umbraco? Would upgrading to 4.11 help?
Thanks for your help
Comment author was deleted
Hmm should work then, mind sending me the form export? You can send it to tg at umbraco dot com thanks
Tim, did you recieve the file?
We are experiencing the same issue, Umbraco v 4.11.8, Latest Contour (from project page) v 3.0.14.
Comment author was deleted
Looking into it, update will follow today
Comment author was deleted
Ok I can see why this is happening so looking into a fix
Basicly it's because the fields don't have an id in the export (it creates a new id in import) but the conditions do have the fieldid stored so it's trying to insert a condition with a field id that doesnt exist
Comment author was deleted
Working on the fix now, should be ready today/tomorrow
Comment author was deleted
Ok found a fix :)
You'll need to update to 3.0.15 WIP version that you can find here
http://nightly.umbraco.org/Umbraco%20Contour/3.0.15%20WIP/
For upgrade instructions please check
http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Installation/Upgrade
To fix you'll also need to export the form again since the new export will include the field ids and will then map them with the new ids
Please let me know if this fixes the issue
Regards, Tim
Thanks Tim,
I'm getting the guys to test it now.
Comment author was deleted
Ok make sure to update both export and import instance of Umbraco :)
Thanks Tim! i'm able to export and import on 2 different sites both using Contour 3.0.15WIP with conditions in the forms, and no errors. I do have an unrelated issue, but will start a new thread..
Thanks again!
Brian.
Hello Tim,
Sorry for the delayed response. I can confirm that this now works, however we cannot delete a form any more, this is the message that appears:
Comment author was deleted
@Jo, all forms or just the imported ones?
@Tim forms that have been imported are having this issue
Comment author was deleted
Ok thanks for the extra details I'll take a look
Hi Tim, did you get any luck with this?
Comment author was deleted
@Jo not yet been on hols but will look into it this week :)
Tim -
For the record, we're also not able to delete imported forms.
Still on contour 3.0.15 WIP here because we need to be able to export/import between staging and live / Umbraco 4.11.8
Additionally, we are having a problem with a mandatory radio button list not passing validation when one of the items is selected (this happens in preview and also when the form is used)
Any ideas?
Comment author was deleted
@Brain did you change anything to the form markup? Might be that the validation expects some classes that aren't there anymore
Tim -
Thanks for the quick response! The only change i'm aware of is to /umbraco/plugins/umbracoContour/Views/Form.cshtml - the location of the DefaultForm.css is changed to the site/css directory so our Editor can change the styles.
I will compare the contour directories against the 3.0.15 WIP files again and let you know if any others were changed..
Thanks again!
Brian.
Tim -
I'm able to reproduce with a fresh install of Umbraco 4.11.8, no modifications, installed Contour 3.0.15 WIP.
Created template to display the form adding the 4 required jQuery references for Contour version 3.x + (jquery-1.8.2, jquery-ui, jquery.validate, and jquery.validate.unobtrusive)
Create form with 1 mandatory radiobuttonlist and 1 conditional Textfield based on the radiobuttonlist
Preview form from Contour editForm page (uses previewFormDialogMvc.aspx)
Select one of the radio button list items, click submit, receive mandatory message (expected to be able to submit without receiving mandatory message here).
Insert form on content page using "Insert form from Umbraco Contour (Razor)" macro.
Save & Publish content form
View in browser, select one of the radio button list items, click submit, receive mandatory message (expected to be able to submit without receiving mandatory message here).
Tested in both IE 9, and Firefox 24. (no script errors in either browser, and conditional field is working correctly in preview / form view)
Hello Tim,
We have this issue too with mandatory radio buttons.
is working on a reply...