Dynamic Forms and reCAPTCHA

Topics: Customizing Orchard
Dec 18, 2014 at 7:54 PM
I've been playing with Orchard 1.x and I noticed that the Dynamic Forms module uses the new Layouts feature, which I love by the way, and elements for form fields instead of the fields already defined in the Fields module. I created a new reCAPTCHA module that uses Google's new version of reCAPTCHA as opposed to that used by the current AntiSpam module for Orchard 1.8. As such I cannot use my new reCAPTCHA field with the new dynamic forms. Will I need to create a reCAPTCHA form element separate from my reCAPTCHA field? Thank you. Keep up the great work, Orchard is amazing.
Developer
Dec 18, 2014 at 9:32 PM
Thanks for the praise!

You are correct, Orchard is amazing, and also in that you'll need to create a reCAPTCHA form element, since Dynamic Form elements have nothing to do with content fields.
You'll see that Dynamic Forms already comes with a ReCaptcha element. You could either fork 1.x and update its implementation (and submit a pull request), or copy its implementation into your own module and modify it as needed.

Let me know if you have any questions implementing form elements.
Dec 18, 2014 at 11:43 PM
I keep getting all these errors when trying to create and build a new module within Orchard 1.x I tried to use the package manager to update my versions of the below assemblies but that didn't work either. Any ideas? Thank you.

1>------ Build started: Project: Orchard.GoogleRecaptcha, Configuration: Debug Any CPU ------
1> No way to resolve conflict between "NHibernate, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" and "NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4". Choosing "NHibernate, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" arbitrarily.
1> No way to resolve conflict between "Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" and "Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4". Choosing "Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" arbitrarily.
1> No way to resolve conflict between "Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da" and "Autofac, Version=3.3.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da". Choosing "Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da" arbitrarily.
1> Consider app.config remapping of assembly "Autofac, Culture=neutral, PublicKeyToken=17863af14b0044da" from Version "3.3.0.0" [] to Version "3.5.0.0" [C:\inetpub\Orchard 1.x\src\Orchard\bin\Debug\Autofac.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "Iesi.Collections, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" from Version "1.0.1.0" [] to Version "4.0.0.0" [C:\inetpub\Orchard 1.x\src\Orchard\bin\Debug\Iesi.Collections.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "NHibernate, Culture=neutral, PublicKeyToken=aa95f207798dfdb4" from Version "3.3.1.4000" [] to Version "4.0.0.4000" [C:\inetpub\Orchard 1.x\src\Orchard\bin\Debug\NHibernate.dll] to solve conflict and get rid of warning.
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Autofac" culture="neutral" publicKeyToken="17863af14b0044da" /><bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="Iesi.Collections" culture="neutral" publicKeyToken="aa95f207798dfdb4" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="NHibernate" culture="neutral" publicKeyToken="aa95f207798dfdb4" /><bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000" /></dependentAssembly></assemblyBinding>
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
1> Orchard.GoogleRecaptcha -> C:\inetpub\Orchard 1.x\src\Orchard.Web\Modules\Orchard.GoogleRecaptcha\bin\Orchard.GoogleRecaptcha.dll
========== Build: 1 succeeded, 0 failed, 22 up-to-date, 0 skipped ==========
Dec 18, 2014 at 11:51 PM
Edited Dec 18, 2014 at 11:51 PM
Also, I'd be willing to build the new Google reCAPTCHA into the AntiSpam module (and update the element as well) and submit it for incorporation in the Orchard Core but it requires a second module I created to handle alias binding in models since the new reCAPTCHA API names it's field g-recaptcha-response instead of g_recaptcha_response.
Dec 19, 2014 at 5:27 AM
I can't seem to figure out the errors above. The referenced assemblies mentioned appear to have been updated since Orchard 1.8.1 but when I look in the reference manager dialogue it still only finds the old versions for these assemblies. Do I need to update something? These errors happen when trying to build almost any module within the 1.x project.