[Progress Communities] [Progress OpenEdge ABL] Forum Post: ControllerWrapper changing the request HTTP verb when invoking HandleUnknownAction

  • Thread starter Thread starter jacopo furla
  • Start date Start date
Status
Not open for further replies.
J

jacopo furla

Guest
Hello, we're upgrading from 10.2 to 12.2 and we're experiencing a blocking problem. In many pages we have custom widgets that post forms back to themselves that have stopped working after the upgrade. After extensive debugging we found out that when these widgets are placed in a detail page (a page showing the details of an entry of a list) the Feather system is calling the protected override void HandleUnknownAction(string actionName) method of the controller of the widget because it thinks that the url-name of the item that is appended to the URI is the action invoked. E.g. We have a page called "Foo" which displays the details of an item selected from a list. The URI of the page when displaying an item is /foo/hello-world where /foo is the URI of the page and hello-world is the URL name of the item. The Feather system when calling the controllers of the widgets placed in the Foo page is passing hello-world as the action. The problem lies in how the HandleUnknownAction method is called. The HandleUnknownAction method is called by the public void CallHandleUnknownAction(string actionName) method in Telerik.Sitefinity.Mvc.ControllerWrapper , in this method a new HTTP context is created, forcing its HTTP verb to GET : public void CallHandleUnknownAction(string actionName) { if (AjaxRequestExtensions.IsAjaxRequest(this.controller.Request)) { return; } MethodInfo methodInfo = ((IEnumerable ) this.controller.GetType() .GetMethods(BindingFlags.Instance | BindingFlags.NonPublic)) .Where ((Func ) (m => m.Name == "HandleUnknownAction")) .SingleOrDefault (); if (!(methodInfo != (MethodInfo) null) || !(methodInfo.DeclaringType != typeof (Controller))) { return; } using (new HttpMethodRegion(this.controller.ControllerContext, "GET")) { methodInfo.Invoke((object) this.controller, new object[1] { (object) actionName }); } } This is effectively changing every request to a GET request, regardless of which verb has been used by the browser. Since our controllers have their action bound to the POST verb — using the [HttpPost] attribute — all these requests can no longer be handled. We couldn't find anything about this in the release notes, but this problem is blocking our upgrade since we loose a good chunk of features. Is changing the HTTP verb a conscious decision by Sitefinity or a bug? How can we correctly POST forms in details pages?

Continue reading...
 
Status
Not open for further replies.
Back
Top