2

Resolved

Rules : Add or Edit an Event makes an error

description

Repro :
I add an event in a Rule

then, it redirects to the /Admin/Rules/Edit/{id} page and there is an error :

The given key was not present in the dictionary.
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at CallSite.Target(Closure , CallSite , Object , String ) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at Orchard.Core.Contents.Rules.ContentEvents.FormatPartsList(Object context) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at Orchard.Core.Contents.Rules.ContentEvents.<Describe>b__12(Object context) at Orchard.Rules.Controllers.AdminController.Edit(Int32 id) in ...OrchardSources\src\Orchard.Web\Modules\Orchard.Rules\Controllers\AdminController.cs:line 200

comments

Stanton_R wrote Jun 12, 2013 at 8:52 AM

Got the same error creating a rule for a custom contact form.

Stanton_R wrote Jun 19, 2013 at 11:01 AM

Hi There

I have resolved my issue by using the workflow module.

Content created for contenttype contact us form.
Send email.

Access from fields in body

from : {Request.Form:ContactUsForm.Name.Value} <br />
hello : {Request.Form:ContactUsForm.Surname.Value} <br />
Message: {Request.Form:ContactUsForm.Message.Text} <br />

Hope this helps

Stanton

agriffard wrote Jun 27, 2013 at 8:23 AM

I don"t have the problem anymore with the latest version.

Stanton_R wrote Jun 27, 2013 at 9:44 AM

Nice man good to see its fixed for you.

I have also downloaded the latest 1.x version but there is still an issue when creating a rule for a custom form.

sebastienros wrote Jul 9, 2013 at 12:33 AM

Sypke fixed it in changeset fb2bbd282607 (2013-06-29 18:01:56 +0200 )

jao28 wrote Jul 15, 2013 at 9:06 PM

I am on the latest version (just pulled 1.x today) and am having issues with the change that was made here https://orchard.codeplex.com/SourceControl/changeset/fb2bbd282607#file_diff_src/Orchard.Web/Modules/Orchard.CustomForms/Rules/CustomFormEvents.cs

I had to change it BACK to lower case "contenttypes" to get it to work. All my old custom form rules had the lowercase "contenttypes" in the database - look in this table: {Tenant}_Orchard_Rules_EventRecord, "Parameters" column

When I make a new custom form rule it also returns the "key" as "contenttypes" so it seems to me it needs to be lower case "contenttypes" for everything to work. Will watch to see if anyone else is having same issue.