Error deleting element

Posted by Community Admin on 03-Aug-2018 00:29

Error deleting element

All Replies

Posted by Community Admin on 05-Sep-2011 00:00
I have a custom module using OpenAccess and when I try to delete an entity I get the following error:

Invalid parameter Name
Parameter name: paramName 
  at Telerik.Microsoft.Practices.Unity.InterceptionExtension.ParameterCollection.IndexForInputParameterName(String paramName)
   at Telerik.Microsoft.Practices.Unity.InterceptionExtension.ParameterCollection.get_Item(String parameterName)
   at Telerik.Sitefinity.Security.AuthorizationPermissionProvider.AuthorizeInput(IMethodInvocation input)
   at Telerik.Sitefinity.Security.SitefinityAuthorizationCallHandler.Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext)
   at Telerik.Microsoft.Practices.Unity.InterceptionExtension.HandlerPipeline.Invoke(IMethodInvocation input, InvokeHandlerDelegate target)
   at Telerik.Microsoft.Practices.Unity.InterceptionExtension.PolicyInjectionBehavior.Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext)
   at Telerik.Microsoft.Practices.Unity.InterceptionExtension.InterceptionBehaviorPipeline.Invoke(IMethodInvocation input, InvokeInterceptionBehaviorDelegate target)
   at DynamicModule.ns.Wrapped_OpenAccessProvider_0b89c35fd5a849edad2f6201e1d9e5a3.DeleteGroup(AdvertisementGroup group)
   at Modules.Advertisements.Data.AdvertisementsManager.DeleteGroup(Guid id) in AdvertisementsManager.cs:line 226
   at Modules.Advertisements.Web.UI.BackendAdvertisementsControl.DeleteGroup(Guid groupId) in BackendAdvertisementsControl.cs:line 1221
   at Modules.Advertisements.Web.UI.BackendAdvertisementsControl.OnAdGroupGridItemCommand(Object sender, GridCommandEventArgs e) in BackendAdvertisementsControl.cs:line 652


The entity does not inherit from content item. It's just a plain entity.
Posted by Community Admin on 07-Sep-2011 00:00
Hi Brian Crosby,

This is a very strange error, could you send us the code for your custom module so we could reproduce the problem locally?

Kind regards,
Lubomir Velkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 09-Apr-2012 00:00
What was the solution to this problem? I am getting the exact same issue, but, related to a class that does inherit from the content class. It seems to only occur when attempting to delete the master item, and I do not get the error when I try to delete a temp item.
Posted by Community Admin on 10-Apr-2012 00:00
I don't remember for sure what the fix was. But I think it might have been an attribute. Try removing any attributes you have on your method and see if that fixes your problem. Sorry I couldn't be more help.

Cheers,
Brian
Posted by Community Admin on 18-Apr-2012 00:00
I fixed this issue after hearing back from Support. Basically, I just had to do a find/replace on the word "product" for the word "partner" (in this case, I based my module on the product module and my module is for "Partners"). Support specifically pointed me to the ParameterPermission Attribute that I decorated my DeletePartner method with, which I had defined as so:

[ParameterPermission("partner", PartnersConstants.Security.PermissionSetName, PartnersConstants.Security.Delete)]
        public abstract void DeletePartner(PartnerItem partner);

My "DeletePartner" method in my OpenAccessProvider then needed to have the attribute that is passed called "partner", whereas I had it defined as "product".

ORIGINAL DELETE PARTNER (Doesn't work):
public override void DeletePartner(PartnerItem product)

NEWLY UPDATED DELETE PARTNER:
public override void DeletePartner(PartnerItem partner)

Once I did a find/replace in my project, it worked. Hopefully this information will be helpful to someone.
This thread is closed